<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="../css/jquery-weui.css" />
		<link rel="stylesheet" type="text/css" href="../css/weui.min.css" />
		<link rel="stylesheet" type="text/css" href="../css/common.css?01_38" />
		<link rel="stylesheet" type="text/css" href="../css/templet.css?01_38" />
		<link rel="stylesheet" type="text/css" href="../fonts/font-awesome.min.css?01_38" />
		<link rel="stylesheet" type="text/css" href="../mui/css/mui.css?01_38" />
		<link rel="stylesheet" type="text/css" href="../css/switch.css?01_38" />
		<!--公共js-->
		<script type="text/javascript" src="../common/js/jquery.js?01_38"></script>

		<!--插件-->
		<script type="text/javascript" src="../common/js/vue.min.js?01_38"></script>
		<script type="text/javascript" src="../common/js/mui.min.js?01_38"></script>
		<script type="text/javascript" src="../common/js/fastclick.js?01_38"></script>
		<script type="text/javascript" src="../common/js/common.js?01_38"></script>
		<script type="text/javascript" src="../common/js/main.js?01_38"></script>
		<script type="text/javascript" src="../common/js/app.js?01_38"></script>
		<!--<script type="text/javascript" src="../common/js/jquery-weui.js"></script>-->
		<style>
			.all_sel {
				position: fixed;
				top: 48px;
				z-index: 10000;
				width: 100%;
			}
			
			.all_sel .sel {
				background: #fd5749;
				color: white;
			}
			
			.order_detail .opt>p {
				border-right: 1px solid #e9e9e9;
				border-bottom: 1px solid #e9e9e9;
				box-sizing: border-box;
			}
			
			.order_detail .opt td:active {
				background: #fd5749;
				color: white;
			}
			
			.order_detail .all .pack.sel {
				background-color: #fd9210;
				color: #fff;
			}
			
			.order_detail .all .wait.sel {
				background-color: #795fff;
				color: #fff;
			}
			
			.ol_boder {
				border: 1px solid #e9e9e9;
			}
			
			.order_detail .all .bg.sel {
				width: 15px;
				height: 15px;
				background-image: url(../images/w/pack_w.png);
				background-size: cover;
				display: inline-block;
			}
			
			.order_detail .all .bg_02.sel {
				background-image: url(../images/w/wait_w.png);
			}
			
			.wrap_body .content .menu .item:first-of-type {
				margin-top: 45px;
			}
			
			.order .classify .menu {
				height: 9.8rem;
			}
			
			.order .classify .menu_1 {
				height: 85vh;
			}
			
			.order .classify .content {
				height: 10.8rem;
			}
			
			.order .classify .content_1 {
				height: 85vh;
			}
			
			.cf:before {
				content: none;
				display: none;
			}
			
			header {
				height: 50px;
			}
			
			header .back {
				top: 0;
				bottom: 0;
				margin: auto;
			}
			
			header .back a {
				top: 7px;
			}
			
			header .search {
				top: 10px;
			}
			
			.mask .minus,
			.mask .add {
				width: 35px;
				height: 35px;
			}
			
			.mask.menu .top div:first-child {
				width: 150px;
				height: 36px;
			}
			
			.wrap .wrap_num {
				left: 0;
				right: 0;
				margin: auto;
				font-size: 20px;
				bottom: 0;
				top: 5px;
			}
			
			.pad-t-46 {
				padding-top: 46px;
			}
			
			.mui-popup {
				z-index: 99999999;
			}
			
			.mui-popup-backdrop {
				z-index: 99999998;
			}
			
			.pack_mask_box,
			.mask {
				position: fixed;
			}
		</style>
	</head>

	<body>
		<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="display:none;">
			<symbol id="f_jia" viewBox="0 0 42 42">
				<path d="M28.559,18.838H14.22a1.787,1.787,0,1,0,0,3.575H28.559a1.787,1.787,0,1,0,0-3.575h0Z" transform="translate(-0.391 0.375)" />
			</symbol>
			<symbol id="f_jian" viewBox="0 0 42 42">
				<path d="M28.559,18.838H23.182V13.476a1.792,1.792,0,0,0-3.585,0v5.362H14.22a1.787,1.787,0,1,0,0,3.575H19.6v5.362a1.792,1.792,0,0,0,3.585,0V22.413h5.377a1.787,1.787,0,1,0,0-3.575h0Z" transform="translate(-0.391 0.375)" />
			</symbol>
			<symbol id="f_9" viewBox="0 0 33 33">
				<path d="M683.575,266.345l-7.846-7.846,7.849-7.849a3.7,3.7,0,0,0-5.231-5.231l-7.849,7.849-7.846-7.846a3.7,3.7,0,0,0-5.232,5.232l7.846,7.846-7.849,7.849a3.7,3.7,0,1,0,5.231,5.231l7.849-7.849,7.846,7.846a3.7,3.7,0,0,0,5.232-5.232h0Z" transform="translate(-656.344 -244.344)" />
			</symbol>
			<symbol id="f_11" viewBox="0 0 92 92">
				<path d="M377,340a46,46,0,1,0,46,46,46,46,0,0,0-46-46h0Zm-6.064,66.157-3.95,3.95-0.276.277L347.23,390.9l4.227-4.226,15.253,15.254L402.542,366.1l4.227,4.226-35.833,35.833h0Z" transform="translate(-331 -340)" />
			</symbol>
			<symbol id="f_qingkong" viewBox="0 0 33 33">
				<path d="M552.074,1713.12h-6.832v-1.59a3.575,3.575,0,0,0-3.589-3.53H531a3.576,3.576,0,0,0-3.59,3.53v1.59h-6.484a0.91,0.91,0,1,0,0,1.82h2.2v22.53a3.575,3.575,0,0,0,3.59,3.53h19.916a3.575,3.575,0,0,0,3.589-3.53v-22.53h1.853a0.9,0.9,0,0,0,.926-0.91,0.991,0.991,0,0,0-.926-0.91h0Zm-22.695-1.59a1.768,1.768,0,0,1,1.737-1.71h10.652a1.768,1.768,0,0,1,1.737,1.71v1.59H529.379v-1.59h0Zm18.989,25.6c0,1.02-.579,2.05-1.5,2.05H526.947a1.894,1.894,0,0,1-1.968-1.59l0.116-22.65h23.273v22.19h0Zm-17.136-17.3a0.849,0.849,0,0,0-.927.91v12.18a0.927,0.927,0,0,0,1.853,0v-12.18a0.991,0.991,0,0,0-.926-0.91h0Zm5.789,0a0.849,0.849,0,0,0-.926.91v12.18a0.926,0.926,0,0,0,1.852,0v-12.18a0.991,0.991,0,0,0-.926-0.91h0Zm5.789,0a0.849,0.849,0,0,0-.926.91v12.18a0.927,0.927,0,0,0,1.853,0v-12.18a0.992,0.992,0,0,0-.927-0.91h0Z" transform="translate(-520 -1708)" />
			</symbol>
		</svg>
		<header style="height: 52px;" class="bg-red9 fff f-20 pad-t-10 pad-b-10  pad-r-10">
			<div class="pa back pad-l-10 re" onclick="back()">
				<div class="order_back"></div>
				<a></a>
			</div>
			<div class="center" data-l="1283"></div>
			<div class="pa search pad-r-10 pad-t-5">
				<a onclick="cli_search()" class=""></a>
			</div>
		</header>
		<div id="loding" class="mask pa loading bg-fff" style="background-color: #fff;">
			<div class="pad-l-40 pad-r-40 pad-t-200">
				<div class="bg-fff wrap pr center ">
					<img src="../images/default_graph/animation.gif" />
				</div>
			</div>
		</div>
		<div id="app" class=" order" v-cloak>
			<!--点餐情况界面-->
			<div v-show="shade">
				<div class="pad-t-46 bg-e2dfdf" v-if="clock_v">
					<div class="set_meal" v-if="Object.keys(cookbook).length !=-100  " style="position: inherit;">
						<div class="bg-e2dfdf pad-10  set_meal_wrap mag-t-5" style="padding-bottom: 0; padding-top:20px; height: 66px;">
							<div id="cook_book" class="cf " style="white-space: nowrap; height: 66px;">
								<div v-for="(v,k) in cookbook" class="item mag-r-10" v-if="v.show==1" :class="{'bg-red9':k==cookbook_current}" @click="select_cookbook(v,k,2)" style="display: inline-block;">
									<div class=" bg-fff f-18 pad-l-15 pad-r-15 pad-t-10 text">
										<span>{{v.cookbook_name}}</span>
										<span v-if="v.all_num" class="num num_01 bg-red9 center f-12 pr fff">{{v.all_num}}</span>
									</div>
								</div>
							</div>
						</div>
					</div>
					<div class="classify cf">
						<div style="width: 92px; height: 100vh;" class="bg-grayF5 fl">
							<!--333-->
							<div id="cont2" class="fl bg-grayF5 menu" :class="{'menu_1' :Object.keys(cookbook).length ==1}">
								<ul class="center c000">
									<li v-for="(v,k) in foods" @click="cli_cook_list(k,v)" v-if="v.show==1" style="overflow: hidden;position: relative;" class="btn_c" :class="{active:k==active}">
										<div class="mag-t-20 mag-b-20">{{v.goods_cate_name}}</div><span v-if="v.list_num!=0" class="num num_02 bg-red9 center f-12 pr fff" style="position: absolute; top: 5px; right: 0;">{{v.list_num}}</span>
									</li>
									<li style="height: 80px;"></li>
								</ul>
							</div>
						</div>
						<div id="cont" class="oh bg-fff content" :class="{'content_1' :Object.keys(cookbook).length ==1}">
							<p class="title mag-l-6 pad-t-10">
								<span class="mag-r-7 bg-red9 pr l"></span><span>{{book_conent.goods_cate_name}}</span>
							</p>
							<div class="pad-l-15 pad-r-15 c000 ">
								<ul class=" ">
									<li class="">
										<div v-for="(v,k) in foods_list" v-if="v.show==1 && v.out_of !=-1 && v.over!=1 && book_conent.package!=1" @click="select_show(k,v)" class="list pad-t-15 pad-b-15 btn_c pr">
											<div v-show="v.over" class="pa bg-fff" style=" opacity: 0.5; width: 100%; height: 85%;"></div>
											<div>
												<div class="cf">
													<div class="fl f-16">{{v.goods_name}}</div>
												</div>
												<p class="f-13 pad-t-5">{{v.sn}} </p>
											</div>
											<div class="c999 f-13 pad-t-5 cf pr">
												<div class="fl red9">{{v.goods_price}}</div>
												<div v-if="v.part[cookbook_id]" class="fr red9 pa" style="right: 0; bottom:-3px;">X<span class="f-20">{{v.part[cookbook_id]}}</span></div>
												<!--<div v-show="v.over" class="fr red9">{{b_lg[1285]}}</div>-->
												<div v-show="v.over" class="fr red9 pr f-18">{{b_lg[1285]}}</div>
											</div>
										</div>
										<div v-for="(v,k) in foods_list" v-if="v.show==1 && v.out_of !=-1 && v.over && book_conent.package!=1" @click="select_show(k,v)" class="list pad-t-15 pad-b-15 btn_c pr">
											<div v-show="v.over" class="pa bg-fff" style=" opacity: 0.5; width: 100%; height: 85%;"></div>
											<div>
												<div class="cf">
													<div class="fl f-16">{{v.goods_name}}</div>
												</div>
												<p class="red9 f-13 pad-t-5">{{v.sn}} </p>
											</div>
											<div class="c999 f-13 pad-t-5 cf">
												<div class="fl">{{v.goods_price}}</div>

												<div v-if="v.part[cookbook_id]" class="fr red9">X{{v.part[cookbook_id]}}</div>
												<div v-show="v.over" class="fr red9 pr f-18">{{b_lg[1285]}}</div>
											</div>
										</div>
										<!--套餐选择展示-->
										<div v-for="(v,k) in foods_list" v-if="book_conent.package==1" @click="taocan_fun(v)" class="list pad-t-15 pad-b-15 btn_c pr">
											<div v-show="v.over" class="pa bg-fff" style=" opacity: 0.5; width: 100%; height: 85%;"></div>
											<div>
												<div class="cf">
													<div class="fl f-16">{{v.goods_name}}</div>
												</div>
												<p class="f-13 pad-t-5">{{v.sn}}</p>
											</div>
											<div class="c999 f-13 pad-t-5 cf pr">
												<div class="fl red9">{{v.goods_price}}</div>
											</div>
										</div>
									</li>
								</ul>
								<div class="list pad-t-15 pad-b-15 btn_c pr" style="height: 50px;"></div>
							</div>
						</div>
					</div>
					<div class="pay">
						<div class="ok fiex">
							<div @click="cli_cook()" class="fiex8 fiex price bg-333">
								<div class="pr">
									<div class="pr">
										<img v-if="shop_all.num!=0" src="../images/set/car_01.png" class="car pa" />
										<img v-else src="../images/set/car_02.png" class="car pa " />
									</div>
									<span v-if="shop_all.num!=0" class="num num_04 bg-red9 fff f-12 center pa">{{shop_all.num}}</span>
								</div>
								<div class="fiex1 fff mag-l-70 f-20">
									<span></span>
									<span>{{(shop_all.spec).toFixed(2)}}</span>
								</div>
							</div>

							<div @click="cli_cook()" :class="sel_cookbook_memory_memory.length!=0?'bg-red9':'bg-999'" class="fiex4 center btnOk pad-t-15">
								<!--<a href="orderDetail.html" class="fff f-15">选好了</a>-->
								<a href="javascript:;" class="fff f-15">{{b_lg[1284]}}</a>
							</div>
						</div>

					</div>
				</div>
				<!--接口未加载完成界面-->
				<div v-else>
					<div class="mask pa bg-fff loading" style="background-color: #fff;">
						<div class="pad-l-40 pad-r-40 pad-t-200">
							<div class="bg-fff wrap pr center ">
								<img src="../images/default_graph/animation.gif" />
							</div>
						</div>
					</div>
				</div>
			</div>

			<!--点餐界面-->
			<div v-show="order" class="select_book">
				<div class="menu">
					<header class="bg-red9 fff f-18 pad-10" style="padding-left: 0; margin-top: 2px; overflow: hidden;">
						<div @click="close_select_show()" class="pa back pad-l-10 re">
							<div class="order_back"></div>
							<a style="top: 6px;"></a>
						</div>
						<div class="center mag-t-2">{{b_lg[1288]}}</div>
					</header>

					<div class="content pad-l-10 pad-r-10 c000 pad-t-45">
						<div class="top pad-t-15 pad-b-15">
							<div class="cf">
								<div class="fl f-18">{{sel_cookbook_memory.goods_name}}</div>
								<div style="display: none;" class="pr fl mag-l-5 chili_wrap">
									<img src="../images/set/chili_01.png" class="chili pa" alt="" />
									<img src="../images/set/chili_02.png" class="chili pa" alt="" />
									<img src="../images/set/chili_03.png" class="chili pa" alt="" />
								</div>
							</div>
							<p class="f-13 mag-t-5 " style="position: relative;"><span>{{sel_cookbook_memory.sn}}</span><span class="fr f-16 red9 pa" style="bottom: -2px; right: 0;">{{sel_cookbook_memory.goods_price}}</span></p>
						</div>
						<!--选择规格-->
						<div class="bottom">
							<div v-if="sel_cookbook_memory.spec_list!=''" class="pad-t-15">
								<p class="f-15">{{b_lg[1289]}}</p>
								<ul id="sel_spece" class="cf f-13 pad-t-15 pad-b-15 center">
									<li v-for="(v,k) in sel_cookbook_memory.spec_list" @click="click_spece(k,v)" :class="{pitch :v.spec_id == active}" class="fl pad-t-10 pad-b-10 pr mag-b-5 mag-r-5 pad-l-10 pad-r-10" style="box-sizing:border-box;">
										<p>{{cookbook_childen.all_spec[v.spec_id]}}</p>
										<p class="f-10 center mag-t-3">{{v.goods_price}}</p>
									</li>
								</ul>
							</div>

							<div v-if="sel_cookbook_memory.taste_list!=''" class="pad-t-15">
								<p class="f-15">{{b_lg[1290]}}</p>
								<ul class="cf f-13 mag-t-15 pad-b-15 center">
									<li v-for="(v,k) in sel_cookbook_memory.taste_list" @click="click_taste(k,v)" :class="{pitch :v.taste_id==shopping_cart.taste.taste_id}" class="fl pad-t-10 pad-b-10 pr mag-b-5 mag-r-5 pad-l-10 pad-r-10" style="box-sizing:border-box;">
										<p>{{cookbook_childen.all_taste[v.taste_id]}}</p>
										<p class="f-10 center mag-t-3">{{v.goods_price}}</p>
									</li>
								</ul>
							</div>

							<div v-if="sel_cookbook_memory.garnish_list!=''" class="pad-t-15">
								<p class="f-15">{{b_lg[1291]}}</p>
								<ul id="side_dish" class="cf f-13 mag-t-15 pad-b-15 center">

									<li v-for="(v,k) in sel_cookbook_memory.garnish_list" :granish_id="v.garnish_id" @click="click_garnish(k,v,$event)" class="fl pad-t-10 pad-b-10 pr mag-b-5 mag-r-5 pad-l-10 pad-r-10" style="box-sizing:border-box;">
										<p>{{cookbook_childen.all_garnish[v.garnish_id]}}</p>
										<p class="f-10 center mag-t-3">{{v.goods_price}}</p>
										<span class="num red9 bg-fff f-12 pa hide">0</span>
									</li>

								</ul>
							</div>
							<div class="pad-t-15">
								<div class="cf">
									<div class="fl mag-t-5">{{b_lg[1292]}}</div>
									<div style="float: right; margin-right: 4px;">
										<input @click="test_btn()" :checked="beizhu" class="weui-switch beizhu-open" id="other_set0_2" style="vertical-align: top;" type="checkbox">
									</div>
								</div>
							</div>

							<!--备注隐藏-->
							<div :class="{hide:!beizhu}">
								<div class="remark fiex pad-l-15 pad-r-15 mag-t-15 f-13">
									<input @click="inp_cli" v-model="beizhu_cont" type="text" :placeholder="b_lg[1309]" class="fiex1 pad-t-15 pad-b-15 pad-r-10" />
									<span class="pen"></span>
								</div>
								<ul id="beizhu" class="beizhu cf center f-13 mag-t-15 pad-b-15">
									<div v-for="(v,k) in beizhu_json" class="fl mag-b-5 mag-r-5" v-show="v.list!=0">
										<ol class="cf fiex ol_boder">
											<li style="white-space:nowrap" v-for="(v1,k1) in v.list" @click="sel_beizhu(k1,v1,$event)" :sel_id="v1.id" class="fl fiex1">{{v1.name}}</li>
										</ol>
									</div>
								</ul>
							</div>
						</div>

						<div class="cf all bg-fff center mag-t-15">
							<table style="width: 100%;  border-collapse: separate;">
								<tbody>
									<tr>
										<td style="border-radius: 10px; width: 49%;" class="pack pad-r-10 " :class="{opt:pack==1}" @click="sel_pack()">
											<p style="min-height: 30px;" class="fiex f-left  pad-t-10 pad-b-10"><span class="bg pr mag-r-10  mag-l-10"></span><span class="fiex1">{{b_lg[1293]}}</span></p>
										</td>
										<td style="width:2%; border: 0;"></td>
										<td style=" border-radius: 10px; width: 49%;" class="wait pad-r-10 " :class="{opt:wait==1}" @click="sel_wait()">
											<p style="min-height: 30px;" class="fiex f-left pad-t-10 pad-b-10"><span class="bg bg_02 pr mag-r-10 mag-l-10"></span><span class="fiex1">{{b_lg[1294]}}</span></p>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
					</div>

				</div>
				<div class="bank60"></div>

				<div class="pay">
					<div class="ok fiex">
						<div class="fiex8 price red9 pad-l-12 pad-t-5 bg-fff fiex">
							<div class="fiex1 f-20">
								<span></span>
								<span>{{(total_money*cook_num).toFixed(2)}}</span>
							</div>
							<div class="cf center c000 pr f-13 number mag-r-15">
								<div @touchstart="move_cook" class="fl circle red9 minus" style="width: 30px; height: 30px; position: relative;">
									<div class="order_add"></div>
								</div>
								<div class="fl circle pad-l-5 pad-r-5 fiex fiex_c f-20">{{cook_num}}</div>
								<div @touchstart="add_cook" class="fl circle red9 add add_02" style="width: 30px; height: 30px; position: relative;">
									<div class="order_add"></div>
								</div>
							</div>
						</div>
						<!--点餐界面的确认按钮-->
						<div class="fiex4 bg-red9 center pad-t-15 pad-b-15" @click="cli_confirm()">
							<a href="javascript:;" class="fff f-15">{{b_lg[1008]}}</a>
						</div>
					</div>

				</div>
			</div>

			<!--弹窗-->
			<div v-if="windows.state" id="succ" class="mask bg-000 pa menu" style="z-index: 100;">
				<div class="pad-l-20 pad-r-20 pad-t-200">
					<div class="bg-fff wrap pr pad-t-25" style="overflow: hidden; ">
						<div class="top cf pad-l-20 pad-r-20 pad-b-20">
							<div class="fr pr" style="width: 110px;">
								<span class="minus pa" style="left: 0;" @click="cle_bt()"></span>
								<span class="pad-l-20 pad-r-20 pa center wrap_num" style="left: 0; right: 0; margin: auto; width: 10px;">{{windows.num}}</span>
								<span class="add pa" @click="add_bt()" style="right: 0;"></span>
							</div>
							<div class="oh">
								<p class="f-18 c000 f-20">{{windows.name}}</p>
								<p class="red9 f-15 mag-t-5 f-20">{{(windows.price*windows.num).toFixed(2)}}</p>
							</div>
						</div>
						<div class="bottom center cf">
							<div class="col-sm-6 c000 pad-t-12 pad-b-12" @click="close_bt()">{{b_lg[1049]}}</div>
							<div class="col-sm-6 bg-red9 fff pad-t-12 pad-b-12" @click="ok_btn()">{{b_lg[1008]}}</div>
						</div>
					</div>
				</div>
			</div>
			<div v-show="cook" class="wrap_body order_detail">
				<header class="bg-red9 fff f-20 pad-t-5 pad-b-5  pad-r-10" style="height: auto;">
					<div @click="clo_cook_content" class="pa back pad-l-10 re">
						<div class="order_back"></div>
						<a class="mag-t-3" style="top: -2px;"></a>
					</div>
					<div class="center">
						<p class="f-15 ellipsis">{{table_name}}{{b_lg[1271]}}
						</p>
						<p class="f-13">{{num_bth}}{{b_lg[1070]}}</p>
					</div>
					<div class="pa regulate fiex center" @click="all_check()">
						<a v-if="ticked" class="fff f-13 pad-r-10 mag-t-9" href="javascript:;" style="display: inline-block;">{{b_lg[1098]}}</a>
						<a v-else class="fff f-13 pad-r-10 mag-t-9" href="javascript:;" style="display: inline-block; margin-top: 11px;">{{b_lg[1310]}}</a>
					</div>
				</header>

				<div class="content pad-t-45">

					<div class="menu" id="cook_list">
						<!--全选-->
						<div class="bg-fff cf center opt f-13 all_sel fiex" :class="{hide:!ticked}">
							<table width="100%">
								<tbody>
									<tr style="border: 1px solid #e9e9e9;">
										<td style="border-right: 1px solid #e9e9e9;" class="pad-10" id="all_sel" @click="header_all_btn()">{{b_lg[1311]}}</td>
										<td style="border-right: 1px solid #e9e9e9;" class="pad-10" @click="all_pcak()">{{b_lg[1293]}}</td>
										<td style="border-right: 1px solid #e9e9e9;" class="pad-10" @click="all_wait()">{{b_lg[1294]}}</td>
										<td style="border-right: 1px solid #e9e9e9;" class="pad-10" @click="all_delete()">{{b_lg[1142]}}</td>
									</tr>
								</tbody>
							</table>

						</div>
						<!--vue报错的地方-->
						<div v-for="(v,k) in sel_cookbook_memory_memory" class="item mag-b-5">
							<!--套餐数据渲染-->
							<div v-if="v.is_package_goods==1" style="overflow: hidden;" @click="list_sle_ticked">
								<div class="list cf pad-t-15 pad-b-10 b_no fiex bg-fff pad-l-12">
									<div class="fiex1 btn_c">
										<div class="fiex">
											<div class="fl">
												<div v-if="ticked" class="list_sel mag-r-15 ticked" @click="sle_ticked()">
													<div class="list_sel_c" :sel_id="k"></div>
												</div>
												<div v-else class="mag-r-15 center num_sort">
													{{k+1}}
												</div>
											</div>
											<div @click="rest(v,k)" class="oh fiex1">
												<p class="f-20">(<span>{{b_lg['1512']}}</span>) {{v.goods_name}}</p>
												<div class="c999">
													<dl class="cf">
														<dd class="oh" v-for="(v2,k2) in v.package_goods_list">
															<div><span class="mag-r-10" style="vertical-align: text-top;">{{v.package_cate_list[v2.cate_id].name}}</span><span class="red9 f-10">x{{v2.count}}</span></div>
															<!--规格-->
															<div style="text-indent:20px ;"><span class="c000">{{all_food[v2.goods_id].goods_name}}</span><span v-if="v2.spec_id!=0">[{{guige[v2.spec_id]}}]</span></div>
															<!--口味-->
															<div style="text-indent:20px ;"><span v-if="v2.taste_id!=0">[{{kouwei[v2.taste_id]}}]</span></div>
															<!--配菜-->
															<div style="text-indent:20px ;" v-for="(v3,k3) in v2.garnish_ids ">{{peicai[v3.garnish_id]}}<span> x{{v3.count}}</span></div>
														</dd>
													</dl>
												</div>
												<div>
													<span style="margin-bottom: 0;" v-if="v.is_pack==1" class="remark r_01 fl">{{b_lg[1509]}}</span>
													<span style="margin-bottom: 0;" v-if="v.is_wait==1" class="remark r_02 fl">{{b_lg[1511]}}</span>
												</div>
											</div>
										</div>
									</div>
									<div style="width: 85px;margin-right: 12px;">
										<div class="fr fiex wrap" style="padding-bottom: 4px;">
											<div class="f-right number" style="margin-right: -6px;">
												<span>x</span><span class="part">{{v.count}}</span>
											</div>

											<div class="f-right price red9">
												<span></span><span class="pric">{{v.total_price}}</span>
											</div>
										</div>
										<div v-if="!ticked" style="width: 85px;" class="fr cf center c000 pr f-13 number">
											<div class="fl circle red9 minus" style="position: relative;" @touchstart="mov_btn(v,k)">
												<div class="order_add"></div>
											</div>
											<!--模板添加-->
											<div class="fl circle pad-l-5 pad-r-5 mag-l-5" style="padding-top: 0;box-sizing: border-box; font-size: 17px;">{{v.count}}</div>
											<div class="fr circle red9 add" style="position: relative;" @touchstart="add_btn(v,k)">
												<div class="order_add"></div>
											</div>
										</div>
									</div>
								</div>

							</div>

							<div @click="list_sle_ticked" class="bg-fff pad-l-12 pad-r-12 f-13" style="position: relative;" v-else>
								<div class="list cf pad-t-15 pad-b-10 b_no fiex">
									<div class="fiex1 btn_c">
										<div class="fiex">
											<div class="fl">
												<div v-if="ticked" class="list_sel mag-r-15 ticked" @click="sle_ticked()">
													<div class="list_sel_c" :sel_id="k"></div>
												</div>
												<div v-else class="mag-r-15 center num_sort">
													{{k+1}}
												</div>
											</div>

											<div @click="alter(k,v.id)" class="oh fiex1">
												<p v-if="all_food[v.id]" class="f-20">{{all_food[v.id].goods_name}}</p>
												<div class="c999">
													<dl class="cf">
														<dd class="oh">
															<span v-if="v.spec_id!=''&&v.spec_id.length!=0&&v.spec_id!='0'">[{{cookbook_childen.all_spec[v.spec_id]}}]</span>
															<span v-if="v.taste_id!=''&&v.taste_id.length!=0&&v.taste_id!='0'">[{{cookbook_childen.all_taste[v.taste_id]}}]</span>
															<div v-for=" (v1,k1) in v.garnish">
																<span>{{cookbook_childen.all_garnish[v1.garnish_id]}}</span>
																<span class="red9 mag-l-5">x{{v1.num}}</span>
															</div>
														</dd>
													</dl>
													<div v-if="v.pack==1||v.wait==1" class="r ov" style="margin-bottom: 3.5px; margin-top: 1px;">

														<span style="margin-bottom: 0;" v-if="v.pack==1" class="remark r_01 fl">{{b_lg[1509]}}</span>
														<span style="margin-bottom: 0;" v-if="v.wait==1" class="remark r_02 fl">{{b_lg[1511]}}</span>
													</div>
													<div v-if="v.beizhu" style="width: 70%;" style="margin-top: -1px;">
														<span v-for="(v1,k1,$index) in v.beizhu.select">{{beizhu_memory[v1].name}}<span v-if="$index+1<Object.keys(v.beizhu.select).length">,</span>
														</span>{{v.beizhu.cont}}

													</div>
												</div>
											</div>

										</div>

									</div>
									<div style="width: 85px;">
										<div class="fr fiex wrap" style="padding-bottom: 4px;">
											<div class="f-right number" style="margin-right: -6px;">
												<span>x</span><span class="part">{{v.part}}</span>
											</div>

											<div class="f-right price red9">
												<span></span><span class="pric">{{parseFloat(v.spec).toFixed(2)}}</span>
											</div>
										</div>
										<div v-if="!ticked" style="width: 85px;" class="fr cf center c000 pr f-13 number">
											<div class="fl circle red9 minus" style="position: relative;" @touchstart="mov_btn(k)">
												<div class="order_add"></div>
											</div>
											<div class="fl circle pad-l-5 pad-r-5 mag-l-5" style="padding-top: 0;box-sizing: border-box; font-size: 17px;">{{v.part}}</div>
											<div class="fr circle red9 add" style="position: relative;" @touchstart="add_btn(k)">
												<div class="order_add"></div>
											</div>
										</div>
									</div>
								</div>

							</div>

						</div>

					</div>
				</div>

				<div class="center bg-fff end pad-t-18 pad-b-18 pad-l-12 pad-r-12 fiex mag-t-10">
					<hr class="fiex1" />
					<div class="mag-l-5 mag-r-5 c999">End</div>
					<hr class="fiex1" />
				</div>

				<!--间隔-->
				<div class="bank10 bg-grayF5"></div>
				<!--整单打包和稍后上菜-->
				<table class="cf all bg-fff center" style="width: 100%;">
					<tbody>
						<tr style="border-bottom: 1px solid #e9e9e9;">
							<td @click="order_pack()" class="pack pad-t-20 pad-b-20" :class="{'sel':order_cli_pack}" style="width: 50%;">
								<p class="fiex"><span class="bg pr mag-r-10 mag-l-10" :class="{'sel':order_cli_pack}"></span><span class="fiex1 f-left mag-t-3">{{order_pack_c}}</span></p>
							</td>
							<td @click="order_wait()" class="wait pad-t-20 pad-b-20" :class="{'sel':order_cli_wait}" style="width: 50%;">
								<p class="fiex"><span class="bg bg_02 pr mag-r-10 mag-l-10" :class="{'sel':order_cli_wait}"></span><span class="fiex1 f-left mag-t-3">{{order_wait_c}}</span></p>
							</td>
						</tr>
					</tbody>
				</table>

				<div class="bg-fff pad-l-12 pad-r-12 f-13 pad-b-60">
					<p class="fiex">
						<span>{{b_lg[1274]}}：</span>
						<input type="" name="" id="" value="" :placeholder="b_lg[1312]" v-model="remarks" class=" pad-t-20 pad-b-20 fiex1" />
					</p>
				</div>

				<div class="fiex bg-fff pay" style="overflow: hidden;">
					<div class="red9 fiex4 pad-l-12 f-20">{{(shop_all.spec).toFixed(2)}}</div>
					<div @click="affirm_cook()" class="fiex3 center">
						<a :class="sel_cookbook_memory_memory.length!=0?'bg-red9':'bg-999'" class="fff pad-t-15 pad-b-15 col-sm-12">{{b_lg[1313]}}</a>
					</div>
				</div>
			</div>

			<div v-if="search" class="wrap_body order_search">

				<header class="bg-red9 fff f-20 pad-t-10 pad-b-10  pad-r-10">
					<div @click="search_back()" class="pa back pad-l-10">
						<a></a>
					</div>
					<div class="center search_wrap pr"><input type="text" :placeholder="b_lg[1286]" class="pad-8" v-model="search_in" /></div>
				</header>

				<div class="content pad-t-50">
					<div v-if="search_result&&search_in!=''" class="info pad-l-15 pad-r-15 pad-t-5">
						<div v-for="(v,k) in foods_class" v-if="Object.keys(v.search_list).length!=0">
							<div class="f-16 sort pad-l-10">{{v.goods_cate_name}}</div>
							<!--333-->
							<div v-for="(v_2,k_2) in v.search_list" class="list pad-t-15 pad-b-15">
								<div @click="taocan_fun(v_2)" v-if="v_2.package_cate_list">
									<div class="cf">
										<div class="fl f-16">{{v_2.goods_name}}</div>
									</div>
									<p class="red9 f-13 pad-t-5">{{v_2.sn}}</p>
									<div class="c999 f-13 pad-t-5 cf">
										<div class="fl">{{v_2.goods_price}}</div>
										<div v-if="v_2.foods_allnum" class="fr red9">X{{v_2.foods_allnum}}</div>
										<div v-show="v_2.over==1" class="fr cf center  pr f-13 number red9">{{b_lg[1285]}}</div>
									</div>
								</div>
								<div @click="select_show(k_2,v_2,'','type')" v-else>
									<div class="cf">
										<div class="fl f-16">{{v_2.goods_name}}</div>
									</div>
									<p class="red9 f-13 pad-t-5">{{v_2.sn}}</p>
									<div class="c999 f-13 pad-t-5 cf">
										<div class="fl">{{v_2.goods_price}}</div>
										<div v-if="v_2.foods_allnum" class="fr red9">X{{v_2.foods_allnum}}</div>
										<div v-show="v_2.over==1" class="fr cf center  pr f-13 number red9">{{b_lg[1285]}}</div>
									</div>
								</div>
							</div>
							<div class="bank5"></div>
						</div>
					</div>
					<div v-else class="no_info pa center c999">
						<!--<div class="bg"></div>-->
						<div style="height: 120px; width: 120px;">
							<img style="width: 100%; height: 100%;" src="../images/default_graph/no.png" />
						</div>
						<p class="mag-t-5">{{b_lg[1287]}}</p>
					</div>
				</div>

			</div>
			<!--点餐成功-->
			<div v-if="order_success" class="wrap_body register">
				<header class="bg-red9 fff f-20 pad-t-10 pad-b-10 pad-l-10 pad-r-10">
					<div class="pa back">
						<a href="javascript:;" @click="jum_table()"></a>
					</div>
					<div class="center">{{b_lg[1314]}}</div>
				</header>
				<div class="text pad-t-45">
					<p class="center mag-t-100"><img src="../images/default_graph/cooked.png" alt="" class="success_img" /></p>
					<p class="center mag-t-40 f-22">{{b_lg[1315]}}</p>
					<div class="mag-t-45 center f-15">
						<a style="display: inline-block; width: 150px;" @click="jum_table()" href="javascript:;" class="red9 pad-l-50 pad-r-50 pad-t-15 pad-b-15 reg_btn">{{b_lg[1314]}}</a>
					</div>
				</div>
			</div>
			<!--套餐模板-->
			<div class="pack_mask_box" id="pack_box" v-if="open" style="z-index: 9999999;">
				<div class="fiex box1">
					<div class="fiex1 box2 bg-fff" style="height: 100%;">
						<div class="box3" style="height: 100%;">
							<div class="bg-fff fiex1" style="position: relative; border-radius: 2px; height: 100%;">
								<div class="close" @click="close()">
									<svg class="g2">
										<use xlink:href="#f_9"></use>
									</svg>
								</div>
								<div class="pad-5 pad-t-7">
									<div class="center f-14  pad-b-15"><span @click="close()" class="fl" style="background: url(../images/pre.png); width: 20px; height: 20px; display: inline-block; background-size:100% 100% ; "></span>(<span>{{b_lg[1512]}}</span>){{obj_select.name}}</div>

									<div class="taocan-head">
										<div class="w ">
											<span v-for="(v,i) in obj.package_cate_list" class="a" :class="{'on':v.select==1}" style="font-size: 15px;" @click="tab(i)">{{v.cate_name}}</span>
										</div>
									</div>
									<div class="line-ddd mag-t-10 mag-b-10"></div>
									<!--222-->
									<div class="taocan-body" style="height: 58vh; overflow:auto; ">
										<div class="b oh" v-for="(v,i) in obj.package_cate_list" v-show="v.select==1">
											<div class="list_name f-left"><span class="f-15 mag-r-10">{{v.cate_name}}</span> <span class="c999">{{b_lg['1519']}} <i class="red f-12 f-bold">{{v.count}}</i></span></div>
											<div class="bank20"></div>
											<ul class="list cf ">
												<li v-for="(vv,ii) in v.goods_list" :class="{'on':vv.select==1,'cur':(obj_child?ii==obj_child.b:0)}" v-if="vv.status==1">
													<div class="duigou">
														<svg class="g2">
															<use xlink:href="#f_11"></use>
														</svg>
													</div>
													<div class="w f-left" @click="select_list(i,ii)">
														<div class="n oh ellipsis-2 f-16">{{all_food[vv.goods_id].goods_name}}</div>
														<div class="b fiex f-12">
															<div class="fiex1 red">
																<template v-if="vv.goods_price!='0.00'">+{{vv.goods_price}}</template>
																<template v-else="">&nbsp;</template>
															</div>
															<div class="c999 " v-if="vv.spec_list.length || vv.taste_list.length || vv.garnish_list.length">{{b_lg['1520']}}</div>
														</div>
													</div>
												</li>

												<li v-for="(vv,ii) in v.goods_list" v-if="vv.status==0">
													<div class="w f-left null">
														<div class="n oh ellipsis-2 f-16">{{all_food[vv.goods_id].goods_name}}</div>
														<div class="b fiex f-12">
															<div class="fiex1"></div>
															<div class="p">{{b_lg[1285]}}</div>
														</div>
													</div>
												</li>
											</ul>
										</div>
									</div>
								</div>
								<div class="bottoms  pad-10">
									<div class=" f-left" style="max-height: 100px; overflow: auto;">
										<p><span class="f-18">{{obj_select.name}}</span>
											<template v-if="obj_select.total_price != obj_select.goods_price">
												<s class="c999 pad-l-10">{{obj_select.goods_price}}</s>
												<i class="f-17 red pad-l-10">{{obj_select.total_price}}</i>
											</template>
											<template v-else>
												<i class="f-17 red pad-l-10">{{obj_select.goods_price}}</i>
											</template>
										</p>

										<div class="cf mag-t-5 f-14" v-for="(v,i) in obj_select.list">
											<span class="fl c333">{{v.cate_name}}：</span>
											<div class="oh">
												<div v-if="v.goods.length">
													<p v-for="(vv,ii) in v.goods">
														<span class="c000">{{all_food[vv.goods_id].goods_name}} </span>
														<span class="red" v-if="vv.goods_price!='0.00'">+{{vv.goods_price}}</span>
														<template v-if="vv.spec_list[0]">
															<span class="c999 mag-l-5">[{{guige[vv.spec_list[0].spec_id]}} ]</span>
															<span class="red" v-if="vv.spec_list[0].goods_price!='0.00'">+{{vv.spec_list[0].goods_price}}</span>
														</template>
														<template v-if="vv.taste_list[0]">
															<span class="c999 mag-l-5">[{{kouwei[vv.taste_list[0].taste_id]}} ]</span>
															<span class="red" v-if="vv.taste_list[0].goods_price!='0.00'">+{{vv.taste_list[0].goods_price}}</span>
														</template>
														<span class="pad-l-5 red " style="color: #3b2cff;"><i class="f-6">x</i> {{vv.count}}</span>
														<template v-if="vv.garnish_list[0]">
															<div class="f-12 c666 pad-l-20">
																<span class="mag-r-10" v-for="(vvv,iii) in vv.garnish_list">
															+{{peicai[vvv.garnish_id]}} 
															<span class="red" v-if="vvv.goods_price!='0.00'">+{{vvv.goods_price}}</span>
																<em v-if="vvv.count>1" class="red" style="color: #3b2cff;"><i cite="f-10">x</i> {{vvv.count}}</em>
																</span>
															</div>
														</template>
													</p>
												</div>
												<div v-else class="red">{{b_lg['1518']}}</div>
											</div>
										</div>
									</div>
									<div class="b mag-t-10">
										<!--加入清单按钮-->
										<a class="bon-red f-16" style="padding: 0.1rem; min-width: 1.6rem;" @click="sub()">{{b_lg['1517']}}</a>
									</div>
								</div>
							</div>

						</div>

					</div>
				</div>
				<!--第二层弹窗-->
				<template v-if="obj_child">
					<div class="bg-fff right-child pad-10 fiex" style="" v-if="obj.package_cate_list[obj_child.a].count > 1 || obj_child.spec_list.length || obj_child.taste_list.length || obj_child.garnish_list.length">
						<div class="fiex1">

							<div class="bg-fff" style="width: 6.6rem; margin: 0 auto; border-radius: 5px; overflow: hidden;">

								<div class="child_name f-18 pad-10">{{all_food[obj_child.goods_id].goods_name}}</div>
								<div class="line-ddd mag-t-10 mag-b-10"></div>
								<div class="w" style=" max-height: 50vh; min-height: 100px; overflow: auto;">
									<dl class="dl cf fiex pad-10 f-14" v-if="obj.package_cate_list[obj_child.a].count > 1">
										<dt class="fiex1 pad-r-10"><span data-l="1160">{{b_lg[1278]}}</span></dt>
										<div class="fiex1">
											<div class="addright_s cf " style="width: 120px;" data-count="1">
												<div class="p p1" @click="select_list_addsub(obj_child.a,obj_child.b,1)"><i></i>
													<svg class="g1">
														<use xlink:href="#f_jia"></use>
													</svg>
												</div>
												<span class="g3 f-20">{{obj_child.count}}</span>
												<div class="p p2 " @click="select_list_addsub(obj_child.a,obj_child.b,2)"><i></i>
													<svg class="g2">
														<use xlink:href="#f_jian"></use>
													</svg>
												</div>
											</div>
										</div>
										<div class="fiex1  f-right pad-r-10" @click="select_list_addsub(obj_child.a,obj_child.b,0)">
											<svg class="g1" style="width: 22px; height: 22px; vertical-align: top;">
												<use xlink:href="#f_qingkong"></use>
											</svg>
										</div>

									</dl>

									<dl class="pad-10 f-14" style="padding-top: 0;" v-if="obj_child.spec_list.length">
										<dt class="mag-b-5">{{b_lg['1521']}}</dt>
										<dd class="cf">
											<a class="a" v-for="(v,i) in obj_child.spec_list" :class="{'on':v.count==1}" @click="guige_select('spec',i)">
												<p>{{guige[v.spec_id]}}</p>
												<span>{{v.goods_price}}</span>
											</a>
										</dd>
									</dl>
									<dl class="pad-10 f-14" style="padding-top: 0;" v-if="obj_child.taste_list.length">
										<dt class="mag-b-5">{{b_lg[1290]}}</dt>
										<dd class="cf">
											<a class="a" v-for="(v,i) in obj_child.taste_list" :class="{'on':v.count==1}" @click="guige_select('taste',i)">
												<p>{{kouwei[v.taste_id]}}</p>
												<span>{{v.goods_price}}</span>
											</a>
										</dd>
									</dl>
									<dl class="pad-10 f-14" style="padding-top: 0;" v-if="obj_child.garnish_list.length">
										<dt class="mag-b-5">{{b_lg[1291]}}</dt>
										<dd class="cf">
											<a class="a" v-for="(v,i) in obj_child.garnish_list" :class="{'on':v.count>=1}" @click="guige_select('garnish',i)">
												<i v-if="v.count>=1">{{v.count}}</i>
												<p>{{peicai[v.garnish_id]}}</p>
												<span>{{v.goods_price}}</span>
											</a>
										</dd>
									</dl>
								</div>
								<div class="line-ddd"></div>
								<div class="bottom">
									<div class="fiex f-18">
										<div class="fiex1 pad-10 pad-t-20 pad-b-20 b c000" @click="guige_sub()">{{b_lg[1008]}}</div>
									</div>
								</div>

							</div>

						</div>
					</div>
				</template>

			</div>
		</div>

		<script>
			var aa = "",
				app = null
			search_memory = {},
				ba_k = getQueryString("back"),
				guqing_obj = {}; //估清

			function cli_back() {
				app.order_back()
			}

			function cli_search() {
				app.search_jum()
			}

			function fun1() {

				aa = (new Date(getItem("now_time") * 1000)).valueOf();
				setlange_obj(); //加载头部语言包
				if(isAPP) {
					win_father(); //关闭掉餐桌页面的窗口
				}

				function win_father() {
					var bac = getQueryString("back")
					if(bac == "tab_sta") {
						var ms = plus.webview.currentWebview().opener()
						ms.evalJS('refresh()')
					}
				}
				app = new Vue({
					el: '#app',
					data: {
						clock_v: false,
						shade: true, //判断显示点餐情况界面 还是点餐界面 true:点餐情况 false:点餐界面
						cook_book_box: { //菜谱大盒子
							box_width: 0 //盒子大的宽度
						},
						c: {},
						b_lg: global_lange, //语言包
						get_old: "",
						shop_card: {}, //接收结构传输的参数
						now_select_shop_card: {},
						table_content: {},
						cart_id: "",
						member_id: "",
						my_member_id: "",
						old: 0, //改单
						table_name: "table_name",
						select_book: {}, //进行点餐的对象
						cookbook: {}, //菜谱
						book_conent: {}, //菜谱的详情
						foods_class: {}, //菜品分类
						foods: {}, //菜品
						active: 0, //默认选择第几种规格
						cookbook_id: "", //菜谱id
						table_id: "", //餐桌id
						num_bth: "", //用餐人数
						req_tabid: "", //所选餐桌id
						req_tabname: "1", //餐桌的名字
						all_food: "", //所有菜品
						foods_list: "", //菜品列表
						cookbook_current: "", //菜谱选择第几个
						beizhu: false, //备注
						beizhu_json: {}, //备注内容
						beizhu_memory: {},
						beizhu_sel_memory: {},
						beizhu_cont: "", //填写的备注内容
						pack: false, //是否打包
						wait: false, //是否稍后上菜
						order_pack_c: global_lange["1322"],
						order_wait_c: global_lange["1323"],
						order_cli_pack: false, //整单打包状态
						order_cli_wait: false, //整单稍后上菜状态
						remarks: "", //整单备注
						cook_num: 1, //所点菜品的数量
						class_list: null, //所选分类
						class_list_number: 0, //所选菜谱分类的序号
						amend: "1", //1:点餐首页 2:修改页面 3:搜索页面
						memory_num: 0, //订单的序号
						ticked: false, //全选
						cookbook_childen: { //菜谱的配置属性
							all_garnish: {}, //所有的配菜
							all_spec: {}, //所有的规格
							all_taste: {}, //所有的口味
							num: "" //选择的次序
						},
						scale_price: 0, //规格的价格
						windows: {
							state: false, //是否选择弹窗
							name: "", //配菜的名字
							price: 0, //配菜的价格
							obj: null, //存储点击的的配菜
							num: 0 //当前选择的配菜的数量
						},
						garnish_sel: { //配菜的选择
							garnish_num: 0, //选择配菜的数量
							price: 0 //配菜的价格
						},
						garnish_list: {}, //配菜id
						taste_sel: { //口味的选择状态
							switch_s: 0 //口味的默认状态
						},
						pitch_sel: { //规格的选择状态
							switch_s: 0, //规格的选择状态
							price: 0 //规格的价格
						},
						shopping_cart: { //购物车
							spec: { //菜品规格
								spec_price: 0,
								spec_id: ""
							},
							garnish: { //菜品配菜 
								garnish_price: {},
								garnish_detail: {}

							},
							taste: { //菜品的口味
								taste_id: ""
							}
						},
						shop_all: {
							spec: 0.00,
							num: 0
						},
						total_money: 0, //总金额
						cuisine_id: "", //所选择的菜品id
						sel_cookbook_memory: {},
						sel_cookbook_memory_memory: [], //用于存储选择后的菜品信息
						cook: false, //确认下厨界面开关
						order: false, //点餐界面开关
						search: false, //查询
						search_in: "", //搜索框输入的内容
						search_list: {}, //搜索结果
						search_result: false, //是否有搜索结果
						order_success: false, //点餐成功
						improve: "0", //是否改单 0:不是改单 1:改单 2:首页直接跳转过来的
						RecipeDetailsClock: "1", //加载备注,配菜,口味 开关 1:默认开启
						package_list: [], //套餐
						open: 0, //是否开启
						obj_index: 0, //套餐索引值
						obj: {}, //套餐对象
						obj_child: null, //选择菜品的属性
						obj_select: {
							name: "",
							id: 0,
							goods_price: 0,
							total_price: 0,
							list: []
						}, //最终选择的对象
						cart_id: null, //是否为修改
						guige: {}, //规格名对象
						peicai: {}, //配菜名对象
						kouwei: {}, //口味对象
						xiugai: "0", //判断套餐是否为修改 默认为不修改(0)
						now_key: "", //当前选择的套餐在购物车数组的位置
						taocan_count: "0" //用于记录每次改单的时候选择的数量
					},
					mounted: function() {
						$("#loding").hide() //关闭外层的加载动画
						var th = this;
						var over = {}
						th.get_old = getQueryString("old") //判断是否为改单
						th.table_id = getQueryString("table_id") //餐桌id
						th.cookbook_id = getQueryString("cookbook_id") //菜谱id
						//以下接口获取餐桌的使用情况(get_shop_table_info)
						th.clock_v = true //加载完成
						if(th.get_old == 1) { //判断是否为改单 1为改单
							common_ajax("1", {
								shop_table_id: th.table_id
							}, "get_shop_table_info", function(h) {
								LoadOver(h)
							})
						} else {
							setTimeout(function() {
								LoadOver()
							}, 0)
						}

						function LoadOver(h) { //加载数据
							over = JSON.parse(getItem("goods_status_list"))
							th.num_bth = getQueryString("num_bth") //用餐人数
							if(h) {
								var a = h.result
								th.num_bth = a.pax //用餐人数
								th.cookbook_id = a.cookbook_id //菜谱 id

							}
							var b = JSON.parse(getItem("table_deail"))
							th.table_name = b[th.table_id].table_name //获取餐桌的名字
							th.req_tabid = b[th.table_id].table_cate_id //获取餐桌分区判断在该分区是否可以使用
							th.Estimate(); //渲染估清等内容 (用于提升渲染速度)
							th.improve = getQueryString("improve"); //获取是否为改单状态
							if(th.improve == 1) {
								th.improve_fun() //启用改单方法
							} else if(th.improve == 2) {
								th.improve_fun(1) //下单
							}
							var cookbook_id = getQueryString("cookbook_id"),
								vartime  = getItem("now_time"); //当前时间
							//添加是否显示
							$.each(th.cookbook, function(k, v) {
								var s = 1;
								if(v.available_btime1 != "0" && v.available_etime1 != "0" && s) { //如果有显示时段
									if(v.available_btime1 < vartime && v.available_etime1 > vartime) {
										s = 1;
									} else {
										s = 0;
									}
								}
								if(v.unavailable_btime1 != "0" && v.unavailable_etime1 != "0" && s) { //如果有隐藏时段
									if(v.unavailable_btime1 < vartime && v.unavailable_etime1 > vartime) {
										s = 0;
									} else {
										s = 1;
									}
								}
								v.show = s;
							})
							//添加是否显示end
							//判断是否有传已经选的菜谱 (用于选菜与加菜使用)
							if(!cookbook_id) { //如果没有选择菜谱默认选择第一菜谱
								$.each(th.cookbook, function(k, v) {
									th.select_cookbook(th.cookbook[v.id], k)
									return false
								})
							} else {
								th.select_cookbook(th.cookbook[cookbook_id], cookbook_id)
							}
						}

					},
					watch: {
						search_in: {
							handler: function() {
								app.search_fun() //搜索方法
							},
							deep: true
						}
					},
					methods: {
						//套餐
						rest: function(a, k) { //修改初始化
							if(app.ticked) { //当点击批处理选按钮后则不可以点击修改订单按钮
								return
							}
							var $th = this,
								newtaocan = null;
							$th.xiugai = 1;
							$th.now_key = k;
							$th.taocan_count = a.count;

							$th.cart_id = {
								cart_id: a.cart_id,
								index: 0
							} //购物车id;
							$.each(app.package_list, function(i, v) {
								if(v.id == a.goods_id) {
									newtaocan = v;
								}
							});
							$th.obj = $.extend(true, {}, newtaocan);
							$th.open = 1;
							$th.obj_select.name = $th.obj.goods_name;
							$th.obj_select.id = $th.obj.id;
							$th.obj_select.goods_price = $th.obj.goods_price;
							$th.obj_select.total_price = $th.obj.goods_price;
							$th.obj_select.sn = $th.obj.sn;
							$th.obj_select.list = [];
							$th.obj_child = null
							$.each($th.obj.package_cate_list, function(i, v) {
								if(i == 0) v["select"] = 1;
								$th.obj_select.list.push({
									cate_name: v.cate_name,
									count: v.count,
									id: v.id,
									goods: []
								}) //插入选择
								$.each(v.goods_list, function(ii, vv) {
									vv['status'] = guqing_obj[vv.goods_id] ? 0 : 1;
									$.each(a.package_goods_list, function(iii, vvv) {
										if(vvv.cate_id == v.id && vvv.goods_id == vv.goods_id) {
											vv["select"] = 1;
											vv["count"] = vvv.count;
											if(vvv.taste_id) {
												$.each(vv.taste_list, function(iiii, vvvv) {
													if(vvvv.taste_id == vvv.taste_id) {
														vvvv["count"] = 1;
													}
												});
											}
											if(vvv.spec_id) {
												$.each(vv.spec_list, function(iiii, vvvv) {
													if(vvvv.spec_id == vvv.spec_id) {
														vvvv["count"] = 1;
													}
												});
											}
											if(vvv.garnish_ids) {
												$.each(vv.garnish_list, function(iiii, vvvv) {
													$.each(vvv.garnish_ids, function(iiiii, vvvvv) {
														if(vvvv.garnish_id == vvvvv.garnish_id) {
															vvvv["count"] = vvvvv.count;
														}
													});
												});
											}
										}
									});

								});

							})
							var ll = $th.obj.package_cate_list
							$th.obj.package_cate_listd = ""
							$th.obj.package_cate_list = ll;
							console.log("$th.obj.package_cate_list", $th.obj.package_cate_list)
							$th.gengxin() //更新选择对象
						},
						taocan_fun: function(v) { //打开套餐选择窗口
							var $th = this;
							$th.open = 1;
							$th.start(v)
						},
						start: function(e) { //初始化
							console.log("初始化", e)
							var $th = this;
							$th.xiugai = 0;
							$th.obj = $.extend(true, {}, e);
							$th.cart_id = null;
							$th.open = 1;
							$th.obj_select.name = $th.obj.goods_name;
							$th.obj_select.id = $th.obj.id;
							$th.obj_select.goods_price = $th.obj.goods_price;
							$th.obj_select.total_price = $th.obj.goods_price;
							$th.obj_select.sn = $th.obj.sn;
							$th.obj_select.list = [];
							$th.obj_child = null
							console.log("分类", $th.obj.package_cate_list)
							$.each($th.obj.package_cate_list, function(i, v) {
								if(i == 0) v["select"] = 1;
								$th.obj_select.list.push({
									cate_name: v.cate_name,
									count: v.count,
									id: v.id,
									goods: []
								}) //插入选择
								guqing_obj = over;
								$.each(v.goods_list, function(ii, vv) {
									vv['status'] = guqing_obj[vv.goods_id] ? 0 : 1;
									if(vv.spec_list[0]) vv.spec_list[0].count = 1; //默认选中第一个规格
									if(vv.taste_list[0]) vv.taste_list[0].count = 1; //默认选中第一个口味

								});
							})
							console.log($th.obj)
						},
						close: function() { //关闭
							this.open = 0;
						},
						//套餐选择种类
						tab: function(i) {
							$.each(this.obj.package_cate_list, function(s, v) {
								if(s == i) {
									v["select"] = 1;
								} else {
									v["select"] = 0;
								}
							});
							this.obj_child = null
							var c = this.obj.package_cate_list
							this.obj.package_cate_list = ""
							this.obj.package_cate_list = c;
						},
						//						二层弹窗
						guige_sub: function() {
							this.obj_child = null;
						},
						select_list_addsub: function(a, b, type) {
							var $th = this,
								$a = this.obj.package_cate_list[a],
								$b = $a.goods_list[b];

							switch(type) {
								case 0: //删除
									$b["select"] = 0;
									$th.obj_child = null
									break;
								case 1: //减少
									$th.obj_child.count--;
									if($th.obj_child.count < 1) {
										$b["select"] = 0;
										$th.obj_child = null
									};
									break;
								case 2: //增加
									var num = 0;
									$.each($th.obj_select.list[a].goods, function(i, v) {
										num += Number(v.count)
									});
									if(accSub($a.count, num) != 0) {
										$th.obj_child.count++;
										if($th.obj_child.count > $a.count) $th.obj_child.count = $a.count;
									} else {
										mui.alert("<p class='f-16 pad-10'>" + app.b_lg['1515'] + "<div class='red pad-l-10 f-20 f-bold'>" + $a.count + "</div></p>", app.b_lg['1320'], app.b_lg['1008'], function() {}, "div")
									}

									break;
							}
							var b = $th.obj_child
							$th.obj_child = ""
							$th.obj_child = b;
							$th.gengxin() //更新选择对象
						},
						select_list: function(a, b, c) { //菜品选择
							var $th = this,
								$a = $th.obj.package_cate_list[a],
								$b = $a.goods_list[b];

							var num = 0;
							$.each($th.obj_select.list[a].goods, function(i, v) {
								num += Number(v.count)
							});

							if($a.count != 1 && $a.count - num <= 0 && $b["select"] != 1) {
								mui.alert("<p class='f-16 pad-10'>" + app.b_lg['1515'] + "<div class='red pad-l-10 f-40 f-bold'>" + $a.count + "</div></p>", app.b_lg['1320'], function() {}, "div")
								return false;
							}

							$b['goods_cate_id'] = $th.all_food[$b.goods_id].goods_cate_id
							$th.obj_child = $b;
							$th.obj_child["count"] = $b.count ? $b.count : 1;
							$th.obj_child["a"] = a;
							$th.obj_child["b"] = b;

							if($a.count == 1) { //如果是一个直接替换
								$.each($a.goods_list, function(i, v) {
									v["select"] = 0;
								});
								$b["select"] = 1;
							} else { //
								$b["select"] = 1;
							}
							$th.gengxin() //更新选择对象
						},
						gengxin: function() {
							var $th = this;
							//更新选择数据
							var price22 = $th.obj_select.goods_price;
							$.each($th.obj.package_cate_list, function(i, v) {
								//console.log();
								if(v.count > 1) {
									$th.obj_select.list[i].goods = [];
								}

								$.each(v.goods_list, function(ii, vv) {
									//$th.obj_select.list[i].goods=[];
									if(vv.select == 1) {
										var nboj = {
											id: vv.id,
											goods_id: vv.goods_id,
											goods_price: vv.goods_price,
											count: vv.count,
											goods_cate_id: $th.all_food[vv.goods_id].goods_cate_id,
											spec_list: [],
											taste_list: [],
											garnish_list: []
										}
										var price_child = vv.goods_price;

										//price=accMul(accAdd(price,vv.goods_price),vv.count)

										//规格
										$.each(vv.spec_list, function(iii, vvv) {
											if(vvv.count >= 1) {
												nboj.spec_list.push(vvv);
												price_child = accAdd(price_child, vvv.goods_price)
											}
										});

										//口味
										$.each(vv.taste_list, function(iii, vvv) {
											if(vvv.count >= 1) {
												nboj.taste_list.push(vvv);
												price_child = accAdd(price_child, vvv.goods_price)
											}
										});

										//配菜
										$.each(vv.garnish_list, function(iii, vvv) {
											if(vvv.count >= 1) {
												nboj.garnish_list.push(vvv);
												price_child = accAdd(price_child, accMul(vvv.goods_price, vvv.count))
											}
										});
										//price=accMul(accAdd(price,price_childe),vv.count);

										console.log(price_child)
										if(v.count > 1) { //如果选择大于1 插入数组
											$th.obj_select.list[i].goods.push(nboj)
										} else { //否则
											$th.obj_select.list[i].goods = [nboj];
										}
										console.log(price22)
										console.log(price_child, vv.count)
										price22 = accAdd(price22, accMul(price_child, vv.count))
										console.log(price22)
									}
								});
							});

							$th.obj_select.total_price = price22;
						},
						//						加入清单方法
						sub: function() {
							var $th = this;
							var jsonobj = {
								goods_name: $th.obj_select.name,
								goods_price: $th.obj_select.goods_price,
								total_price: $th.obj_select.total_price,
								id: $th.obj_select.id,
								sn: $th.obj_select.sn,
								goods_cate_id: 0,
								taocan: 1,
								is_package_goods: 1,
								package_cate_list: [],
								package_goods_list: []
							}
							var stops = true;
							app.search_in = "" //重置搜索栏
							$.each($th.obj_select.list, function(i, v) {
								jsonobj.package_cate_list.push({
									id: v.id,
									name: v.cate_name
								}) //分组
								var numbers1 = 0;
								$.each(v.goods, function(ii, vv) {
									var arrs1 = {
										cate_id: v.id,
										sn: 0,
										member_id: 'test_c',
										goods_cate_id: vv.goods_cate_id,
										count: vv.count,
										goods_id: vv.goods_id,
										goods_name: 0,
										status: 1,
										goods_price: vv.goods_price,
										remarks: 0,
										spec_id: vv.spec_list[0] ? vv.spec_list[0].spec_id : 0,
										goods_spec_name: 0,
										taste_id: vv.taste_list[0] ? vv.taste_list[0].taste_id : 0,
										goods_spec_price: vv.spec_list[0] ? vv.spec_list[0].goods_price : 0,
										goods_taste_price: vv.taste_list[0] ? vv.taste_list[0].goods_price : 0,
										goods_taste_name: 0,
										garnish_ids: []
									}
									numbers1 = accAdd(numbers1, vv.count)
									$.each(vv.garnish_list, function(iii, vvv) {
										arrs1.garnish_ids.push(vvv);
									});
									jsonobj.package_goods_list.push(arrs1); //分组菜品

								});

								if(numbers1 != v.count) { //如果没有选择菜品
									if(!$th.obj.package_cate_list[i].select) {
										$th.tab(i)
									}
									mui.alert("<p class='f-16 pad-10 pad-b-20'>" + app.b_lg['1514'] + "：<span class='red pad-l-5'>" + v.cate_name + "</span> , " + app.b_lg['1278'] + "：<span class='red pad-l-5'>" + v.count + "</span></p>", app.b_lg['1320'], function() {}, "div")
									stops = false;
									if(!stops) return false;
								}

							});

							if(!stops) return false;
							console.log(jsonobj)

							//return false;
							var ndata = new Date(getItem("now_time") * 1000).getTime().toString(),
								cart = "1" + ndata.substring(5, ndata.length - 1) + Math.floor(Math.random() * 1000000),
								sel_count = 1; //数量默认为1 如何为改单读取存储的数量
							console.log("$th", $th)
							if($th.cart_id) {
								sel_count = $th.taocan_count; //记录修改订单时点餐的数量
								cart = $th.cart_id.cart_id
							}

							var data = {
								"cart_id": cart,
								"member_id": getItem("yingsoft_home_member_id"),
								"count": sel_count,
								"goods_cate_id": 0,
								"goods_id": jsonobj.id,
								"taste_id": 0,
								"spec_id": 0,
								"garnish_ids": 0,
								"status": 1,
								"goods_price": jsonobj.goods_price,
								total_price: jsonobj.total_price,
								goods_name: jsonobj.goods_name,
								"remarks": "",
								"is_pack": 0,
								"is_wait": 0,
								"is_give": 0,
								"is_old": 0,
								"cookbook": getItem("cookbook"),
								is_package_goods: 1,
								package_cate_list: jsonobj.package_cate_list,
								package_goods_list: jsonobj.package_goods_list
							};

							$th.open = 0;
							//整理数据格式
							var package_cate_list_obj = {};
							$.each(data.package_cate_list, function(k, v) {
								package_cate_list_obj[v.id] = v
							})
							data.package_cate_list = package_cate_list_obj;
							console.log("123", data)
							if($th.xiugai == 0) {
								app.sel_cookbook_memory_memory.push(data) //添加到我的购物车
							} else {
								app.sel_cookbook_memory_memory[$th.now_key] = data //修改购物车信息
							}
							//购物车统计金额使用（这个共有两处需要 封装成方法）
							var spec_all = 0
							var num_all = 0
							console.log("app.sel_cookbook_memory_memory111", app.sel_cookbook_memory_memory)
							$.each(app.sel_cookbook_memory_memory, function(k, v) {
								if(v.is_package_goods == 1) { //为1的时候说明是套餐
									spec_all = spec_all + (v.total_price) * v.count;
									num_all = num_all + parseInt(v.count)
								} else {
									spec_all = spec_all + parseFloat(v.spec * v.part)
									num_all = num_all + parseInt(v.part)
								}

							})
							app.shop_all.spec = spec_all
							app.shop_all.num = num_all

						},
						guige_select: function(a, b) { //规格口味配菜选择
							var $th = this,
								b = b;
							console.log(a, b)
							switch(a) {
								case 'spec': //规格
									$.each($th.obj_child.spec_list, function(i, v) {
										v["count"] = 0;
									});
									$th.obj_child.spec_list[b]["count"] = 1;
									break;
								case 'taste': //口味
									$.each($th.obj_child.taste_list, function(i, v) {
										v["count"] = 0;
									});
									$th.obj_child.taste_list[b]["count"] = 1;
									break;
								case 'garnish': //配菜

									var garnish_num = $th.obj_child.garnish_list[b]["count"]
									if(garnish_num >= 1) { //如果大于等于1 弹出层

										var html1 = '<div class="peiliaoadd  fiex cf">';
										html1 += '<div class="p p1 fiex1"><i></i><svg class="g1" ><use xlink:href="#f_jia"></use></svg></div>';
										html1 += '<span class="  fiex1"><span class="g3 f-32">' + garnish_num + '</span></span>';
										html1 += '<div class="p p2 fiex1"><i></i><svg class="g2" ><use xlink:href="#f_jian"></use></svg></div>';
										html1 += '</div>';
										var b_index = b;

										var mui_title = $th.peicai[$th.obj_child.garnish_list[b].garnish_id];
										var mui_text = "<p class='dp-1 red'>" + $th.obj_child.garnish_list[b].goods_price + "</p><div class='dp-2 mag-t-20 pad-b-20 pad-r-40 pad-l-40'>" + html1 + "</div>"
										var buttons = [app.b_lg['1516'], app.b_lg['1008']]
										mui.confirm(mui_text, mui_title, buttons, function(e) {
											if(e.index == 1) { //确定按钮
												$th.obj_child.garnish_list[b_index]["count"] = garnish_num;
												var c = $th.obj_child
												$th.obj_child = ""
												$th.obj_child = c;
												$th.gengxin() //更新选择对象
											} else { //取消按钮
												$th.obj_child.garnish_list[b_index]["count"] = 0;
												var c = $th.obj_child
												$th.obj_child = ""
												$th.obj_child = c;
												$th.gengxin() //更新选择对象
											}
										}, "div");
										//数量减
										var $pei = $(".peiliaoadd")
										//console.log($pei)
										$(".peiliaoadd .p1").click(function() {
											garnish_num--;
											if(garnish_num <= 1) {
												garnish_num = 1;
												$pei.addClass("null1")
											};
											$pei.find(".g3").text(garnish_num)
										})
										//数量加
										$(".peiliaoadd .p2").click(function() {
											garnish_num++;
											$pei.removeClass("null1")
											$pei.find(".g3").text(garnish_num)
										})
									} else { //否则加1
										$th.obj_child.garnish_list[b]["count"] = 1;
									}

									break;
								default:
									break;
							}
							var b = $th.obj_child
							$th.obj_child = ""
							$th.obj_child = b;
							$th.gengxin() //更新选择对象
						},
						Estimate: function() { //加载数据加快页面渲染
							//为每一道菜的配菜数量进行限制 
							over = JSON.parse(getItem("goods_status_list"));
							this.guige = JSON.parse(getItem("all_spec"));
							this.peicai = JSON.parse(getItem("all_garnish"));
							this.kouwei = JSON.parse(getItem("all_taste"))
							var foods = JSON.parse(getItem("foods"));
							foods.splice(2, 0, {
								goods_cate_name: app.b_lg['1513'],
								goods_list: [],
								package: 1
							}) //添加套餐
							app.foods = foods //菜谱分类
							app.cookbook = JSON.parse(getItem("cookbook")) //读取缓存的菜谱
							app.all_food = JSON.parse(getItem("all_food")); //所有菜品
							app.package_list = JSON.parse(getItem("package_list")); //套餐
							var change_price = JSON.parse(getItem("change_price")); //修改的菜品价格
							$.each(foods, function(k, v) {
								app.foods_class[v.id] = v
								$.each(v.goods_list, function(k1, v1) { //设置估清
									if(!over[v1.id]) {
										app.all_food[v1.id].over = 0
									} else {
										v1.over = 1
										app.all_food[v1.id].over = 1
									}
									v1.garnish_num = v1.garnish_max_count //设置单个配菜的最大数量
									if(change_price.price_goods_list[v1.id]) {
										$.each(v1.garnish_list, function(k2, v2) { //修改配菜的金额
											if(change_price.price_goods_list[v1.id].ga[v2.garnish_id]) {
												v2.goods_price = change_price.price_goods_list[v1.id].ga[v2.garnish_id];
											}
										});
										$.each(v1.spec_list, function(k2, v2) { //修改规格的金额
											if(change_price.price_goods_list[v1.id].s[v2.spec_id]) {
												v2.goods_price = change_price.price_goods_list[v1.id].s[v2.spec_id];
											}
										});
										if(change_price.price_goods_list[v1.id].price || change_price.price_goods_list[v1.id].price == 0) {
											v1.goods_price = change_price.price_goods_list[v1.id].price;
										}

									}
									//修改每一道菜品修改的价格

								})
							})
							//修改套餐价格
							$.each(app.package_list, function(k, v) {
								if(change_price.price_package_list[v.id]) {
									v.goods_price = change_price.price_package_list[v.id].price
								}
							})
							console.log("app.all_food", app.all_food)
							console.log("app.package_list", app.package_list)
						},
						test_click: function() { //获取所有的备注信息
							var a = $("#beizhu").find(".pitch");
							$.each(a, function(k, v) {
								$(v).attr("sel_id");
							});
						},
						inp_cli: function() { //点开输入备注的时候将屏幕滑到底部防止键盘遮挡住输入框
							setTimeout(function() {
								var h = $(document).height() - 50
								$(document).scrollTop(h);
							}, 200)
						},
						count_spec: function(ty) { //计算菜品菜品总价 ty:当新点击新到的菜谱时传入true
							var all_granish_price = 0
							app.total_money = app.shopping_cart.spec.spec_price //规格的价格
							if(ty) {
								$.each(app.shopping_cart.garnish.garnish_price, function(k, v) {
									all_granish_price = parseFloat(all_granish_price) + parseFloat(v)
								})
							}
							if(app.shopping_cart.taste.goods_price != undefined) {
								app.total_money = parseFloat(app.total_money) + parseFloat(all_granish_price) + parseFloat(app.shopping_cart.taste.goods_price)
							} else {
								app.total_money = parseFloat(app.total_money) + parseFloat(all_granish_price)
							}

							app.total_money = parseFloat(app.total_money).toFixed(2)

						},
						select_cookbook: function(k, v, w) { //当选择菜谱时判断当前时间是否可以使用菜谱v:菜谱id (选择菜谱方法)
							//判断是否容许多菜谱点餐
							if(app.sel_cookbook_memory_memory.length != 0 && app.is_more_cookbook == 0) {
								if(app.sel_cookbook_memory_memory[0].cookbook_id != v) {
									mui.toast(app.b_lg['1307'])
									return
								}
							}
							var th = this
							//判断当前菜谱在本分区是否可以使用
							var zone = th.req_tabid //获取分区
							//获取菜谱与分区关系缓存
							var book_zone = JSON.parse(getItem("book_zone"))

							if(book_zone[zone].indexOf(v) == -1) { //判断当前分区是否含有该菜谱
								mui.toast(app.b_lg['1327'])
								return
							}
							var cood = app.cookbook[v];
							console.log("cood", cood)
							//获取当前时间
							var timestamp = Date.parse(new Date(getItem("now_time") * 1000));
							if(app.improve != 1) { //如果是改单则不执行菜谱时间判断
								//判断当天时候可以使用
								if(cood.week != "") {
									var nwerk = new Date(getItem("now_time") * 1000);
									var now_week = getweek(nwerk);
									if(cood.week.indexOf(now_week) == '-1') {
										mui.toast(app.b_lg['1295'])
										return
									} else {
										if(cood.begin_time != 0 || cood.begin_time1 != 0 || cood.begin_time2 != 0) { //判断是否设置了时间
											var time_obj = {}
											time_obj[1] = {
												'begin_time': cood.begin_time,
												'end_time': cood.end_time
											}
											time_obj[2] = {
												'begin_time': cood.begin_time1,
												'end_time': cood.end_time1
											}
											time_obj[3] = {
												'begin_time': cood.begin_time2,
												'end_time': cood.end_time2
											}
											var start_1 = "0"; //存放如果所有时间段都不可以使用值为0(默认值为0)
											$.each(time_obj, function(k, v) {
												if(v.begin_time != 0) {
													var str = timeQuantum(v.begin_time, v.end_time);
													if(str == 1) { //只要有一次为1则说明在某个时间段可以使用
														start_1 = 1
														return false
													}
												}
											});
											if(start_1 == 0) {
												mui.toast(app.b_lg['1239'])
												return false
											}
										}
									}
								}
							}

							function timeQuantum(begin_time, end_time) { //计算菜谱是否在可容许的时间范围内
								var now_time = time1(timestamp / 1000); //当前时间
								var begin_time = time1(begin_time);
								var end_time = time1(end_time);
								if(end_time > begin_time) {
									//									当天
									if(begin_time < now_time && end_time > now_time) {
										return 1;
									}
								} else {
									//									隔天
									if(begin_time > now_time && end_time < now_time) {
										return 1;
									}
								}
							}

							var beg_time = cood.begin_time
							app.cookbook_id = v; //选择菜谱id
							//判断当前菜谱是否含有对应分类
							app.sel_cookbook_memory = v
							var v1_str = []
							var all_num = 0
							//app.foods 所有的分类
							$.each(app.foods, function(k1, v1) { // v:菜谱id
								var list_num = 0,
									lock = 0; //如果当前分类没有任何菜则隐藏该分类
								$.each(v1.goods_list, function(k2, v2) {
									if(v2.cookbook_id.length == 0) {
										lock = 1;
									}
									$.each(v2.cookbook_id, function(k4, v4) { //取出每道菜所对应的菜谱id
										v1_str.push(v4)
									});

									var a = 0
									$.each(app.sel_cookbook_memory_memory, function(k3, v3) {
										if(v2.id == v3.id) {
											if(v2.part) {
												if(v == v3.cookbook_id) { //判断是否为当前菜谱
													a = a + v3.part
													if(v1.id != 1 && v1.id != 2) {
														all_num = all_num + v3.part
														list_num = list_num + v3.part
													}

												}
											} else {
												if(v == v3.cookbook_id) { //判断是否为当前菜谱
													a = v3.part
													if(v1.id != 1 && v1.id != 2) {
														all_num = all_num + v3.part
														list_num = list_num + v3.part
													}

												}
											}
										}

									})
									if(v2.part) {
										v2.part[v] = a
									}
								})
								$.each(v1_str, function(k, v) {
									if(v == app.sel_cookbook_memory) {
										lock = 1
									}
								})
								if(lock == 1) {
									v1.show = 1
								} else {
									v1.show = 0
								}
								v1_str = []
								v1.list_num = list_num

								//套餐
								var package_arr = [];
								if(v1.package == 1) {
									//									var package_list = JSON.parse(getItem("package_list"));
									var package_list = app.package_list;
									$.each(package_list, function(k, v) {
										if(v.status != 99) {
											$.each(v.cookbook_id, function(k2, v2) {
												if(v2 == app.sel_cookbook_memory) {
													package_arr.push(v);
												}

											});
										}
									});
									v1.goods_list = package_arr
									if(package_arr.length == 0) {
										v1.show = -1;
									} else {
										v1.show = 1;
									}
									console.log("v1.goods_list", v1.goods_list)
								}
							});
							app.foods.all_num = all_num
							app.cookbook[v].all_num = all_num
							var food_storage = app.foods
							app.foods = ""
							app.foods = food_storage
							//默认选择第一个
							app.cookbook_current = v //菜谱选中状态
							if(w != 1) {
								app.cli_cook_list("0", food_storage[0])
							}
						},
						cli_cook_list: function(k, v) { // 点击菜谱分类

							//							333
							app.class_list_number = k //菜谱所选分类的序号
							app.class_list = v.id //菜谱下面分类的id
							if(v.begin_time != 0) { //判断当前菜谱分类所处时间段是否可用
								var timestamp = Date.parse(new Date(getItem("now_time") * 1000)); //获取当前时间精确到了毫秒
								if(v.begin_time > 0 && v.end_time > 0) { //判断是否设置了时间
									var now_time = time1(timestamp / 1000); //当前时间
									var begin_time = time1(v.begin_time);
									var end_time = time1(v.end_time);
									if(end_time > begin_time) {
										if(begin_time > now_time) {
											//											mui.toast(app.b_lg['1296']);
											//											return;
											mui.alert(app.b_lg['1295'], app.b_lg['1320'], "OK", function() {

											}, "div")
											return
										}
									} else {
										if(begin_time < now_time) {
											//											mui.toast(app.b_lg['1296']);
											//											return;
											mui.alert(app.b_lg['1296'], app.b_lg['1320'], "OK", function() {

											}, "div")
											return
										}
									}
								}
							}
							//判断当天时候是否可以使用
							if(v.week != undefined && v.week != '') {
								var nwerk = new Date(getItem("now_time") * 1000);
								var now_week = getweek(nwerk);
								if(v.week.indexOf(now_week) == '-1') {
									mui.alert(app.b_lg['1297'], app.b_lg['1320'], "OK", function() {}, "div")
									return
								}
							}

							app.active = k;
							app.book_conent = v;
							var goods_list_arr = null;
							var lock = 0;
							console.log("app.book_conent", app.book_conent)
							if(app.book_conent.package != 1) { //判断是否为套餐
								$.each(app.book_conent.goods_list, function(k1, v1) {

									if(app.all_food[v1.id].over == 0) {
										v1.over = 0
									} else {
										v1.over = 1
									}
									//									console.log("app.all_food[v1.id]",app.all_food[v1.id])

									goods_list_arr = v1.cookbook_id
									console.log("v1", v1)
									$.each(goods_list_arr, function(k, v) {
										if(v == app.cookbook_id) {
											lock = 1
										}
									});
									if(goods_list_arr.length == 0) {
										lock = 1
									}
									if(lock == 1) {
										v1.show = 1
									} else {
										v1.show = -1
									}
									lock = 0
								})
							} else {
								app.book_conent.goods_list = app.book_conent.goods_list
								console.log("app.book_conent.goods_list", app.book_conent.goods_list)
							}

							var good_list = app.book_conent.goods_list
							app.book_conent.goods_list = ""
							app.book_conent.goods_list = good_list
							app.foods_list = app.book_conent.goods_list;

						},
						select_show: function(k, v, l, type) { //打开选菜界面 k:vue的序号  v:中存储的是当前选中菜品的详细信息 type有值即为搜索页面进入							
							if(app.RecipeDetailsClock == 1) { //当第一次打开菜品详情面加载如下信息
								app.is_more_cookbook = getItem("is_more_cookbook")
								var my_msg = JSON.parse(getItem("my_msg")) //服务员的个人信息
								app.my_member_id = my_msg.member_id
								//								规格以及其他信息储存
								app.cookbook_childen.all_garnish = JSON.parse(getItem("all_garnish")); //获取所有的配菜
								app.cookbook_childen.all_spec = JSON.parse(getItem("all_spec")); //获取所有的规格
								app.cookbook_childen.all_taste = JSON.parse(getItem("all_taste")); //获取所有的口味
								app.beizhu_json = JSON.parse(getItem("beizhu_json")) //读取缓存的备注信息
								$.each(app.beizhu_json, function(k, v) {
									$.each(v.list, function(k1, v1) {
										app.beizhu_memory[v1.id] = {
											id: v1.id,
											name: v1.name
										}
									});
								});
							}
							if(v.over == 1) {
								return
							}
							app.order = true
							app.sel_cookbook_memory = v //对于选中的菜品的基础数据进行渲染
							app.shopping_cart.total_prices = v.goods_price;
							app.cuisine_id = v.id //所选菜品id
							app.beizhu_cont = ""
							if(!l) { //点餐
								//								if(isAPP) {
								//									Android_back_order('order');
								//								}
								app.reset_fun() //重置
								app.pack = false //重置打包状态
								app.wait = false //重置是否等待状态
								app.amend = 1 //默认为点餐首页
								app.active = v.spec_id
								app.shade = false //打开选菜界面
								app.member_id = app.my_member_id
								if(v.spec_list[0]) {
									app.shopping_cart.spec.spec_id = v.spec_list[0].spec_id
									app.shopping_cart.spec.spec_price = v.spec_list[0].goods_price
								} else {
									app.shopping_cart.spec.spec_price = v.goods_price
								}
								if(v.taste_list[0]) {
									app.shopping_cart.taste.taste_id = v.taste_list[0].taste_id
									app.shopping_cart.taste.goods_price = v.taste_list[0].goods_price
								} else {
									app.shopping_cart.taste.taste_id = ""
									app.shopping_cart.taste.goods_price = 0
								}
								app.count_spec(0) //计算当前菜品所选菜品的价格
								$("#beizhu").find("li").removeClass("pitch") //清除所有备注选择项目
								app.beizhu = false //重置默认属性(将备注按钮关闭)
							} else { //修改购物车
								$("#beizhu").find("li").removeClass("pitch") //清除所有备注选择项目
								app.amend = 2
								app.count_spec(false) //计算当前菜品所选菜品的价格
								//菜品备注以及选择内容
								setTimeout(function() { //这里如果没有这个延迟将无法渲染出已选择配菜
									app.sel_granish()
									app.sle_beizhu()
								}, 100)
							}
							if(type != undefined) {
								//								if(isAPP) {
								//									Android_back_order("search_select")
								//								}
								app.search = false
								app.amend = 3
							}
							if(app.beizhu) {
								$(".onoffswitch-label .onoffswitch-inner").css("margin-left", "0")
								$(".onoffswitch-label .onoffswitch-switch").css("right", "0")

							} else {
								$(".onoffswitch-label .onoffswitch-inner").css("margin-left", "-100%")
								$(".onoffswitch-label .onoffswitch-switch").css("right", "18px")

							}

						},
						click_spece: function(k, v) { //选择规格
							app.active = v.spec_id;
							app.shopping_cart.spec.spec_id = v.spec_id
							app.shopping_cart.spec.spec_price = v.goods_price
							app.count_spec(1)
						},
						click_taste: function(k, v) { //选择口味
							app.shopping_cart.taste.taste_id = v.taste_id
							app.shopping_cart.taste.goods_price = v.goods_price
							app.count_spec(1)
						},
						click_garnish: function(k, v, event) { //选择配菜 k: vue渲染页面的id v:当前所选的配菜的id以及价格
							//							if(app.sel_cookbook_memory.garnish_max_count == '0') {
							//								mui.toast(app.b_lg['1299'])
							//								return
							//							}
							var garnish_minute = app.sel_cookbook_memory; //获取当前所选菜品的详细信息
							var garnish_max_garnish_num = parseInt(garnish_minute.garnish_num); //单个配菜的最大数量
							var goods_price = app.garnish_sel.garnish_num //已经选择的配菜数量
							var el = event.currentTarget;
							app.garnish_id = v.garnish_id;
							if(el.classList.contains('pitch')) {
								//                             
								$(".mask").on('touchmove', function(e) {
									e.preventDefault();
								})

								app.windows.obj = el;
								app.windows.name = app.cookbook_childen.all_garnish[v.garnish_id]; //当前所选配菜的名字
								app.windows.num = el.getElementsByTagName("span")[0].innerHTML; //将已近选择的配菜数量填写到弹出框中
								app.windows.price = v.goods_price;
								var total_money = app.windows.num * app.windows.price //总金额	
								app.shopping_cart.total_prices = (parseFloat(total_money) + parseFloat(app.windows.price)).toFixed(2)
								app.windows.state = true; //打开弹窗选择配菜的数量
							} else {
								//判断当前点击的配菜个数是否在允许范围之内
								var max_len = app.sel_cookbook_memory.garnish_max_count //最多可以选择的配菜的数量
								var pit_len = $("#side_dish").find(".pitch").length //获取已经选择配菜的种类
								if(max_len != 0) {
									if(pit_len >= max_len) {
										mui.toast(app.b_lg['1300'] + max_len + app.b_lg['1301'])
										return
									}
								}

								app.shopping_cart.total_prices = (parseFloat(app.shopping_cart.total_prices) + parseFloat(v.goods_price)).toFixed(2)

								el.getElementsByTagName("span")[0].innerHTML = 1
								app.windows.num = 1
								el.classList.add('pitch')
								el.getElementsByTagName("span")[0].classList.remove("hide")
								app.shopping_cart.garnish.garnish_detail[v.garnish_id] = {
									"garnish_id": v.garnish_id,
									"num": app.windows.num
								}
							}
							app.shopping_cart.garnish.garnish_price[v.garnish_id] = v.goods_price * app.windows.num
							app.count_spec(1)

						},
						add_bt: function() {
							var maxcount = parseInt(app.sel_cookbook_memory.garnish_num) //当前所选配菜的最大数量限制
							$.each(app.sel_cookbook_memory.garnish_list, function(k_1, v_1) {
								if(v_1.garnish_id == app.garnish_id) {
									maxcount = v_1.maxcount
									return false
								}
							});
							if(maxcount != 0) {

								if(app.windows.num >= maxcount) {
									mui.toast(app.b_lg['1302'] + maxcount)
									return
								}
							}
							app.windows.num++
						},
						cle_bt: function() { //减少配菜数量
							if(app.windows.num != 0) {
								app.windows.num--
							} else {
								mui.toast(app.b_lg['1303'] + '0');
							}
						},
						close_select_show: function() { //关闭选菜界面
							app.windows.state = false; //关闭弹出层
							if(app.amend == 1) { //判断是否为修改状态
								if(isAPP) {
									//									Android_back_order()
									//									And_back(ba_k)
								}
								app.shade = true
								app.order = false

							} else if(app.amend == 2) {
								//								if(isAPP) {
								//									Android_back_order("list")
								//								}
								app.cook = true
								app.order = false
							} else if(app.amend == 3) { //搜索页面进入
								app.shade = false
								app.order = false
								app.search = true
								// app.search_fun()
							}

							app.cook_num = 1 //重置已选择菜的数目
							app.active = 0 //重置规格选项
							$("#beizhu").find("li").removeClass("pitch")
							app.select_cookbook(app.cookbook[app.cookbook_id], app.cookbook_id, 1)
							app.beizhu_cont = ""
						},
						ok_btn: function() { //弹出窗口点击按钮 确认按钮
							var obj = app.windows.obj;
							obj.getElementsByTagName("span")[0].innerHTML = app.windows.num //将选择的配菜数量填写的展示页面中 

							if(app.windows.num == 0) {
								obj.classList.remove("pitch");
								obj.getElementsByTagName("span")[0].classList.add("hide");
								delete app.shopping_cart.garnish.garnish_detail[app.garnish_id]
								delete app.shopping_cart.garnish.garnish_price[app.garnish_id]
							} else {
								app.shopping_cart.garnish.garnish_price[app.garnish_id] = app.windows.num * app.windows.price
								app.shopping_cart.garnish.garnish_detail[app.garnish_id] = {
									"garnish_id": app.garnish_id,
									"num": app.windows.num
								}
							}

							app.count_spec(1)
							app.windows.state = false; //关闭弹出层
						},
						close_bt: function() { //弹出窗口点击按钮 取消按钮
							app.windows.state = false; //关闭弹出层
						},
						beizhu_bt: function() {
							app.beizhu = !app.beizhu
						},
						sel_beizhu: function(k, v, ev) {
							var el = ev.currentTarget;
							$(el).siblings().removeClass("pitch");
							if(el.classList.contains("pitch")) {
								el.classList.remove("pitch")
							} else {
								el.classList.add("pitch");
							}

						},
						sel_pack: function() {
							app.pack = !app.pack
						},
						sel_wait: function() {
							app.wait = !app.wait
						},
						add_cook: function() {
							app.cook_num++
								event.stopPropagation();
						},
						move_cook: function() {
							var num = app.cook_num;
							if(num <= 1) {
								mui.toast(app.b_lg['1304'])

							} else {
								app.cook_num--
							}

						},
						cli_confirm: function() { //确认选择
							var th = this
							var content = {};
							content.id = app.cuisine_id //菜品id
							content.is_old = app.old //是否改单
							content.spec_id = app.shopping_cart.spec.spec_id //规格
							content.taste_id = app.shopping_cart.taste.taste_id //口味
							content.garnish = app.shopping_cart.garnish.garnish_detail //配菜
							content.beizhu = {} //备注
							var a = $("#beizhu").find(".pitch")
							var cont = {}
							$.each(a, function(k, v) {
								cont[$(v).attr("sel_id")] = $(v).attr("sel_id")
							});
							//                          
							content.beizhu['select'] = cont
							content.beizhu['cont'] = app.beizhu_cont
							content.beizhu['off'] = app.beizhu
							//打包
							if(app.pack == true) {
								content.pack = 1
							} else {
								content.pack = 0
							}
							if(app.wait == true) {
								content.wait = 1
							} else {
								content.wait = 0
							}
							//							content.pack = app.pack
							//							//稍后上菜
							//							content.wait = app.wait
							content.member_id = app.member_id
							content.table_id = app.table_id
							content.spec_id = app.active //规格选择的是第几个
							content.spec_price = app.shopping_cart.spec.spec_price //选择规格的价格
							//							content.taste_sel = app.taste_sel.switch_s //口味选择的是第几个s
							content.spec = app.total_money //单价
							content.cookbook_id = app.cookbook_id //菜谱id

							if(app.class_list == 1 || app.class_list == 2) {
								content.class_list = app.all_food[app.cuisine_id].goods_cate_id //分类id	
							} else {
								content.class_list = app.class_list //分类id	
							}
							content.part = app.cook_num //点餐数量
							var timestamp = Date.parse(new Date(getItem("now_time") * 1000))
							var a = parseInt((Math.random() * 1000))
							if(app.old == 0) {
								content.cart_id = timestamp + a
							} else {
								content.cart_id = app.cart_id
							}
							//关闭后初始化页面的数据
							if(app.amend == 2) { //判断是更新菜单 还是添加新的菜单 ture为更新
								app.sel_cookbook_memory_memory[app.memory_num] = content
								app.cli_cook(true) //调用打包方法,重新计算是否打包情况
							} else if(app.amend == 1 || app.amend == 3) {
								//								if(isAPP) {
								//									if(app.amend == 3) {
								//										Android_back_order("search")
								//									} else {
								//										And_back(ba_k)
								//									}
								//
								//								}
								th.sel_cookbook_memory_memory.push(content)
							}
							//我的购物车数据
							console.log("th.sel_cookbook_memory_memory", th.sel_cookbook_memory_memory)
							app.select_cookbook(app.cookbook[app.cookbook_id], app.cookbook_id, 1)
							app.cli_cook_list(app.class_list_number, app.foods[app.class_list_number])
							app.cook_num = 1 //重置已选择菜的数目
							app.active = app.class_list_number //重置规格的选项
							//统计出购物车的总金额
							var spec_all = 0
							var num_all = 0
							$.each(app.sel_cookbook_memory_memory, function(k, v) {
								if(v.is_package_goods == 1) { //为1的时候说明是套餐
									spec_all = spec_all + parseFloat(v.total_price * v.count)
									num_all = num_all + parseInt(v.count)
								} else {
									spec_all = spec_all + parseFloat(v.spec * v.part)
									num_all = num_all + parseInt(v.part)
								}

							})
							app.shop_all.spec = spec_all
							app.shop_all.num = num_all
							if(app.amend == 1) {
								app.shade = true //关闭选菜界面
								app.order = false

							} else if(app.amend == 2) {
								app.order = false
								app.cook = true
							} else if(app.amend == 3) {
								app.search_fun()
								app.order = false
								app.search = true
							}
							app.amend = 1 //重置是否修改状态
							app.reset_fun() //重置配菜的选择项
							app.search_in = "" //重置搜索栏
						},
						cli_cook: function(k) { //选好了 k:false点击选好了  true点击修改后的确认订单
							if(app.RecipeDetailsClock == 1) { //当第一次打开配菜界面加载如下信息
								app.is_more_cookbook = getItem("is_more_cookbook")
								var my_msg = JSON.parse(getItem("my_msg")) //服务员的个人信息
								app.my_member_id = my_msg.member_id
								app.cookbook_childen.all_garnish = JSON.parse(getItem("all_garnish")); //获取所有的配菜
								app.cookbook_childen.all_spec = JSON.parse(getItem("all_spec")); //获取所有的规格
								app.cookbook_childen.all_taste = JSON.parse(getItem("all_taste")); //获取所有的口味
								app.beizhu_json = JSON.parse(getItem("beizhu_json")) //读取缓存的备注信息
								$.each(app.beizhu_json, function(k, v) {
									$.each(v.list, function(k1, v1) {
										app.beizhu_memory[v1.id] = {
											id: v1.id,
											name: v1.name
										}
									});
								});
							}
							if(app.sel_cookbook_memory_memory.length == 0) {

								mui.alert(app.b_lg['1305'], app.b_lg['1320'], app.b_lg['1190'], function() {
									return
								}, "div")
							} else {
								//								if(isAPP) {
								//									Android_back_order("list")
								//								}
								var memory = app.sel_cookbook_memory_memory
								var pack = 0
								var wait = 0
								$.each(app.sel_cookbook_memory_memory, function(k, v) {
									if(v.pack == 1) {
										pack++
									}
									if(v.wait == 1) {
										wait++
									}
								})
								//确认后计算整单 打包以及用餐情况
								if(memory.length != 0) {
									if(memory.length == pack) {
										app.order_pack_c = app.b_lg['1317']
										app.order_cli_pack = true
									} else {
										app.order_pack_c = app.b_lg['1322']
										app.order_cli_pack = false
									}
									if(memory.length == wait) {
										app.order_wait_c = app.b_lg['1318']
										app.order_cli_wait = true
									} else {
										app.order_wait_c = app.b_lg['1323']
										app.order_cli_wait = false
									}
								}
								if(!k) {
									app.cook = true
									app.shade = false
								}
							}
						},
						alter: function(k, id) { //修改订单内容
							if(app.ticked) { //当点击批处理选按钮后则不可以点击修改订单按钮
								return
							}
							var garnish_memory = {}
							app.amend = true
							app.memory_num = k //订单序号
							var memory = app.sel_cookbook_memory_memory[k]
							app.old = memory.is_old //是否为旧的订单 0:不是 1:是
							app.now_select_shop_card = app.sel_cookbook_memory_memory[k] //用于改单的时候修改配菜使用
							app.active = memory.spec_id //规格选择
							app.garnish_list = memory.garnish //配菜选择
							$.each(memory.garnish, function(k, v) {
								$.each(app.all_food[id].garnish_list, function(k_1, v_1) {
									if(v_1.garnish_id == v.garnish_id) {
										garnish_memory[v.garnish_id] = v_1.goods_price
										return false
									}
								})
							});
							app.cart_id = memory.cart_id
							app.member_id = memory.member_id
							app.shopping_cart.garnish.garnish_detail = memory.garnish //重新为配菜赋值
							app.shopping_cart.garnish.garnish_price = garnish_memory //计算当前所选菜品的总价
							app.shopping_cart.spec.spec_price = memory.spec_price //口味的价格
							app.shopping_cart.taste.taste_id = memory.taste_id //口味选择的是第几个
							app.select_show(1, app.all_food[id], 1)
							app.beizhu_cont = memory.beizhu.cont //备注手输
							app.beizhu = memory.beizhu.off //备注开关
							app.beizhu_sel_memory = memory.beizhu.select //选择的备注
							app.pack = memory.pack //是否打包
							app.wait = memory.wait //是否稍后上菜
							app.cook_num = memory.part //份数 
							app.total_money = memory.spec
							app.cook = false
							app.order = true
							if(app.beizhu) {
								$(".onoffswitch-label .onoffswitch-inner").css("margin-left", "0")
								$(".onoffswitch-label .onoffswitch-switch").css("right", "0")

							} else {
								$(".onoffswitch-label .onoffswitch-inner").css("margin-left", "-100%")
								$(".onoffswitch-label .onoffswitch-switch").css("right", "18px")

							}
						},
						add_btn: function(k, key) { //添加菜品(当为套餐添加时k为Val值，key为索引 ,当为非套餐则是 k为索引 并且不传递key)
							event.stopPropagation();
							if(k.count) { //当存在该属性说明为修改模板数据
								console.log("添加模板", k)
								var pric = app.sel_cookbook_memory_memory[key].total_price
								app.sel_cookbook_memory_memory[key].count = parseInt(app.sel_cookbook_memory_memory[key].count) + 1
								app.shop_all.spec = app.shop_all.spec + parseFloat(pric)
							} else {
								var pric = app.sel_cookbook_memory_memory[k].spec
								app.sel_cookbook_memory_memory[k].part = parseInt(app.sel_cookbook_memory_memory[k].part) + 1
								app.shop_all.spec = app.shop_all.spec + parseFloat(pric)
							}

						},
						mov_btn: function(k, key) { //删除菜品  (参数注释可以查看添加按钮).
							var el = event.currentTarget
							var a = el.nextElementSibling.innerHTML
							var pric = el.parentNode.previousElementSibling.getElementsByClassName("pric")[0].innerText
							console.log("app.sel_cookbook_memory_memory[k]", app.sel_cookbook_memory_memory[k])
							if(!k.count) {
								a_function();
							} else {
								b_function();
							}

							function a_function() { //非模板减少
								var mm = app.sel_cookbook_memory_memory[k]
								if(a == 1) {
									var btnArray = [app.b_lg['1049'], app.b_lg['1008']];
									mui.confirm(app.b_lg['1319'], app.b_lg['1320'], btnArray, function(e) {
										if(e.index == 1) {
											if(mm.is_old == 1) {
												var dat = {}
												dat.shop_table_id = getQueryString("table_id");
												dat.cart_ids = []
												dat.cart_ids.push(app.sel_cookbook_memory_memory[k].cart_id)
												common_ajax("1", dat, "delete_cart_goods", function(h) {
													if(h.status == 1) {
														app.sel_cookbook_memory_memory.splice(k, 1)
														app.shop_all.spec = app.shop_all.spec - parseFloat(pric)
													} else {
														mui.toast(h.msg)
													}
												})
											} else {
												app.sel_cookbook_memory_memory.splice(k, 1)
												app.shop_all.spec = app.shop_all.spec - parseFloat(pric)
											}
											//全部删除后关闭列表页面
											if(app.sel_cookbook_memory_memory.length == 0) {
												app.clo_cook_content()
											}
										}
									}, "div")
								} else {
									app.sel_cookbook_memory_memory[k].part = parseInt(a) - 1
									app.shop_all.spec = app.shop_all.spec - parseFloat(pric)
								}
							}

							function b_function() { //模板减少
								var mm = app.sel_cookbook_memory_memory[key]
								if(a == 1) {
									var btnArray = [app.b_lg['1049'], app.b_lg['1008']];
									mui.confirm(app.b_lg['1319'], app.b_lg['1320'], btnArray, function(e) {
										if(e.index == 1) {
											if(mm.is_old == 1) {
												var dat = {}
												//												dat.shop_table_id = app.sel_cookbook_memory_memory[key].shop_table_id
												dat.shop_table_id = getQueryString("table_id");
												dat.cart_ids = app.sel_cookbook_memory_memory[key].cart_id;
												common_ajax("1", dat, "delete_cart_goods", function(h) {
													if(h.status == 1) {
														app.sel_cookbook_memory_memory.splice(k, 1)
														app.shop_all.spec = app.shop_all.spec - parseFloat(pric)
													} else {
														mui.toast(h.msg)
													}
												})
											} else {
												app.sel_cookbook_memory_memory.splice(key, 1)
												app.shop_all.spec = app.shop_all.spec - parseFloat(pric)
											}
											//全部删除后关闭列表页面
											if(app.sel_cookbook_memory_memory.length == 0) {
												app.clo_cook_content()
											}
										}
									}, "div")
								} else {
									app.sel_cookbook_memory_memory[key].count = parseInt(a) - 1
									app.shop_all.spec = app.shop_all.spec - parseFloat(pric)
								}
							}
							event.stopPropagation();
						},
						all_check: function() { //批处理
							app.ticked = !app.ticked
							if(app.ticked) {
								$("#all_sel").removeClass("sel")
								if($("#cook_list").find(".item")[0]) {
									$("#cook_list").find(".item")[0].classList.add("mag-t-45")
								}
							} else {
								$("#all_sel").removeClass('sel') //移除全选按钮的选中状态
								if($("#cook_list").find(".item")[0]) {
									$("#cook_list").find(".item")[0].classList.remove("mag-t-45")
								}
							}

						},
						sle_ticked: function() { //菜品列表的选择的按钮
						},
						list_sle_ticked: function() { //查看已选订单并点击
							var length = 0
							var el = event.currentTarget
							var sel = $(el).find(".list_sel_c").hasClass("bg-red9")
							if(sel) {
								$(el).find(".list_sel_c").removeClass("bg-red9")
							} else {
								$(el).find(".list_sel_c").addClass("bg-red9")
							}
							var a = $("#cook_list").find(".list_sel ")
							$.each(a, function(k, v) {

								if(v.firstElementChild.classList.contains("bg-red9")) {
									length++
								}
							})
							if(length == a.length) {
								$("#all_sel").addClass("sel")

							} else {
								$("#all_sel").removeClass("sel")
							}

						},
						header_all_btn: function() { //点击全选按钮
							var el = event.currentTarget
							var a = $("#cook_list").find(".list_sel ")
							if(el.classList.contains('sel')) {
								el.classList.remove("sel")
								$.each(a, function(k, v) {
									v.firstElementChild.classList.remove("bg-red9")
								})
							} else {
								el.classList.add("sel")
								$.each(a, function(k, v) {
									v.firstElementChild.classList.add("bg-red9")
								})
							}
						},
						all_pcak: function() { //批处理打包按钮
							var el = event.currentTarget
							var id = []
							var list = $("#cook_list").find(".list_sel_c ")
							var length = 0
							var len_f = 0
							$.each(list, function(k, v) {
								if(v.classList.contains('bg-red9')) {
									id.push(v.getAttribute("sel_id"))
								}
							})
							if(id.length == 0) {
								mui.alert(app.b_lg['1321'], app.b_lg['1320'], "OK", function() {}, "div")
							}
							$.each(id, function(k, v) {
								if(!app.sel_cookbook_memory_memory[v].pack) {
									len_f++
								}

							})
							if(len_f <= id.length && len_f != 0) {
								$.each(id, function(k, v) {
									if(app.sel_cookbook_memory_memory[v]) {
										app.sel_cookbook_memory_memory[v].pack = 1
									}
								});
							} else {
								$.each(id, function(k, v) {
									if(app.sel_cookbook_memory_memory[v]) {
										app.sel_cookbook_memory_memory[v].pack = 0
									}
								});
							}
							//判断是否全部勾选
							var fa = true
							$.each(app.sel_cookbook_memory_memory, function(k, v) {
								if(v.pack == 0) {
									fa = false
									return
								}
							})
							if(app.sel_cookbook_memory_memory.length == 0) {
								fa = false
							}
							if(!fa) {
								app.order_pack_c = app.b_lg['1322']
								app.order_cli_pack = false
							} else {
								app.order_cli_pack = true
								app.order_pack_c = app.b_lg['1317']
							}
						},
						all_wait: function() { //批处理稍后上菜
							var el = event.currentTarget
							var id = []
							var list = $("#cook_list").find(".list_sel_c ")
							var length = 0
							var len_f = 0
							$.each(list, function(k, v) {
								if(v.classList.contains('bg-red9')) {
									id.push(v.getAttribute("sel_id"))
								}
							})
							if(id.length == 0) {
								mui.alert(app.b_lg['1321'], app.b_lg['1320'], "OK", function() {}, "div")
							}
							$.each(id, function(k, v) {
								if(!app.sel_cookbook_memory_memory[v].wait) {
									len_f++
								}

							})
							if(len_f <= id.length && len_f != 0) {
								$.each(id, function(k, v) {
									if(app.sel_cookbook_memory_memory[v]) {
										app.sel_cookbook_memory_memory[v].wait = true
									}
								})
							} else {
								$.each(id, function(k, v) {
									if(app.sel_cookbook_memory_memory[v]) {
										app.sel_cookbook_memory_memory[v].wait = false
									}
								})
							}
							//判断是否全部勾选
							var fa = true
							$.each(app.sel_cookbook_memory_memory, function(k, v) {
								if(v.wait == false) {
									fa = false
									return
								}
							})
							if(!fa) {
								app.order_wait_c = app.b_lg['1323']
								app.order_cli_wait = false
							} else {
								app.order_wait_c = app.b_lg['1318']
								app.order_cli_wait = true
							}
						},
						all_delete: function() { //批处理删除
							var el = event.currentTarget
							var id = []
							var list = $("#cook_list").find(".list_sel_c ")
							var btnArray = [app.b_lg['1049'], app.b_lg['1008']]
							$.each(list, function(k, v) {
								if(v.classList.contains('bg-red9')) {
									id.push(v.getAttribute("sel_id"))
								}
							})
							if(id.length != 0) {
								mui.confirm(app.b_lg['1319'], app.b_lg['1320'], btnArray, function(e) {
									if(e.index == 1) {
										var arr = new Array()
										$("#all_sel").removeClass('sel')
										var a = 0
										$.each(id, function(k, v) {
											if(a != 0) {
												v = v - a
											}
											a = a + 1
											if(app.sel_cookbook_memory_memory[v].is_old == 1) {
												arr.push(app.sel_cookbook_memory_memory[v].cart_id)
											}
											app.sel_cookbook_memory_memory.splice(v, 1)

										})
										if(arr.length != 0) {
											common_ajax("1", {
												shop_table_id: app.table_id,
												cart_ids: arr
											}, "delete_cart_goods", function(h) {
												if(h.status == 1) {
													var spec_all = 0,
														num_all = 0

													$.each(app.sel_cookbook_memory_memory, function(k, v) {
														spec_all = spec_all + parseFloat(v.spec * v.part)
														num_all = num_all + parseInt(v.part)
													})
													app.shop_all.spec = spec_all
													app.shop_all.num = num_all
												} else {
													mui.toast(h.msg)
												}
											})
										}

										var a = $("#cook_list").find(".list_sel ")
										$.each(a, function(k, v) {
											v.firstElementChild.classList.remove("bg-red9")
										})
										//全部删除后关闭列表页面
										if(app.sel_cookbook_memory_memory.length == 0) {
											app.clo_cook_content()
										}
									}
								}, "div")
							} else {
								mui.alert(app.b_lg['1321'], app.b_lg['1320'], "OK", function() {
									console.log("123")
								}, "div")
							}
						},
						order_pack: function() { //整单打包
							if(app.order_pack_c == app.b_lg['1322']) {
								$.each(app.sel_cookbook_memory_memory, function(k, v) {
									app.order_cli_pack = true
									if(v.is_package_goods) {
										v.is_pack = 1
									} else {
										v.pack = true
									}
									app.order_pack_c = app.b_lg['1317']
								})
							} else {
								$.each(app.sel_cookbook_memory_memory, function(k, v) {
									if(v.is_package_goods) {
										v.is_pack = 0
									} else {
										v.pack = false
									}
									app.order_cli_pack = false

									app.order_pack_c = app.b_lg['1322']
								});
							}
							console.log("app.sel_cookbook_memory_memory", app.sel_cookbook_memory_memory)

						},
						order_wait: function() { //整单稍后上菜
							if(app.order_wait_c == app.b_lg['1323']) {
								$.each(app.sel_cookbook_memory_memory, function(k, v) {
									app.order_cli_wait = true
									if(v.is_package_goods) {
										v.is_wait = 1
									} else {
										v.wait = true
									}

									app.order_wait_c = app.b_lg['1318']
								})
							} else {
								$.each(app.sel_cookbook_memory_memory, function(k, v) {
									app.order_cli_wait = false
									if(v.is_package_goods) {
										v.is_wait = 0
									} else {
										v.wait = false
									}
									app.order_wait_c = app.b_lg['1323']
								})
							}
						},
						all_btn: function() {
							var el = event.currentTarget
							if(el.classList.contains('sel')) {
								el.classList.remove('sel')
							} else {
								el.classList.add('sel')
							}
						},
						clo_cook_content: function() { //关闭确认下厨界面
							if($("#cook_list").find(".item")[0]) {
								$("#cook_list").find(".item")[0].classList.remove("mag-t-45")
							}
							$("#all_sel").removeClass("sel")
							app.ticked = false
							app.select_cookbook(app.cookbook[app.cookbook_id], app.cookbook_id, 1)
							app.cli_cook_list(app.class_list_number, app.foods[app.class_list_number])
							//统计出购物车的总金额
							var spec_all = 0
							var num_all = 0
							$.each(app.sel_cookbook_memory_memory, function(k, v) {
								if(v.is_package_goods == 1) { //为1的时候说明是套餐
									spec_all = spec_all + parseFloat(v.total_price * v.count)
									num_all = num_all + parseInt(v.count)
								} else {
									spec_all = spec_all + parseFloat(v.spec * v.part)
									num_all = num_all + parseInt(v.part)
								}
							})
							app.shop_all.spec = spec_all
							app.shop_all.num = num_all
							app.cook = false
							app.shade = true
							//							if(isAPP) {
							//								And_back(ba_k)
							//							}
						},
						sel_granish: function() { //渲染配菜
							var obj = app.garnish_list
							var a = $("#side_dish").find("li")
							$.each(a, function(k, v) {
								if(obj[v.getAttribute("granish_id")]) {
									v.classList.add("pitch")
									v.getElementsByTagName("span")[0].classList.remove("hide")
									v.getElementsByTagName("span")[0].innerHTML = obj[v.getAttribute("granish_id")].num
								}

							});
						},
						sle_beizhu: function() { //渲染已经选择的备注
							var obj = app.beizhu_sel_memory
							var li = $("#beizhu").find("li")
							$.each(li, function(k, v) {
								if(obj[v.getAttribute("sel_id")]) {
									v.classList.add("pitch")
								}
							});
						},
						search_jum: function() {
							//							if(isAPP) {
							//								Android_back_order("search")
							//							}
							app.shade = false //关闭点餐界面
							app.search = true //查询
							app.search_in = "" //重置搜索框
							app.search_fun() //进行一次搜索
						},
						search_btn: function() { //搜索按钮
							app.search_fun()
						},
						search_fun: function() { //搜索方法
							var cookbook_id = app.cookbook_id //当前选中的菜谱id
							var in_p = app.search_in //输入的搜索内容
							var all_food = app.all_food
							var search_list = {}
							$.each(app.foods_class, function(k, v) {
								v.search_list = {}
							});
							var a = app.foods_list
							app.foods_list = {}
							app.foods_list = a
							var foods_allnum = {} //以点菜品的数量
							console.log("app.package_list", app.package_list)
							if(in_p != "") {
								$.each(all_food, function(k, v) {
									if(v.goods_name.indexOf(in_p) != -1) {
										$.each(v.cookbook_id, function(k2, v2) { //判断出是否在当前菜谱
											if(v2 == cookbook_id && v.status != 99) {
												search_list[k] = v
											}
										})
										delete all_food.k
									}
									if(v.sn.indexOf(in_p) != -1) {
										$.each(v.cookbook_id, function(k2, v2) { //判断出是否在当前菜谱
											if(v2 == cookbook_id && v.status != 99) {
												search_list[k] = v
											}
										})
										delete all_food.k
									}
								})
								console.log("111111111", app.package_list)
								$.each(app.package_list, function(k, v) {
									if(v.goods_name.indexOf(in_p) != -1) {
										$.each(v.cookbook_id, function(k2, v2) { //判断出是否在当前菜谱
											if(v2 == cookbook_id && v.status != 99 && !search_list[v.id]) {
												search_list[v.id] = v
											}
										})
									}
									if(v.sn.indexOf(in_p) != -1) {
										$.each(v.cookbook_id, function(k2, v2) { //判断出是否在当前菜谱
											if(v2 == cookbook_id && v.status != 99 && !search_list[v.id]) {
												search_list[v.id] = v
											}
										})
									}

								})
								//								555
								console.log("search_list", search_list)
								$.each(app.sel_cookbook_memory_memory, function(k, v) { //获取以点菜品的数量
									if(foods_allnum[v.id]) {
										foods_allnum[v.id] = parseInt(foods_allnum[v.id]) + parseInt(v.part)
									} else {
										foods_allnum[v.id] = v.part
									}
								})
								app.search_list = search_list //app.search_list 存储搜索到的结果
								$.each(app.search_list, function(k, v) {
									app.foods_class[v.goods_cate_id].search_list[v.id] = v
								})

								//将菜品数量添加到搜索结果中
								$.each(app.foods_class, function(k, v) {
									$.each(v.search_list, function(k_2, v_2) {
										v_2.foods_allnum = foods_allnum[v_2.id]
									})
								})
								var len = Object.keys(search_list).length
								if(len == 0) {
									app.search_result = false
								} else {
									app.search_result = true
								}
							}

							app.order = false //点餐界面开关
							app.search = true //查询
						},
						search_back: function() { //搜索页面返回按钮
							app.shade = true //关闭点餐界面
							app.search = false //查询
						},
						affirm_cook: function() { //提交订单
							if(app.sel_cookbook_memory_memory.length == 0) {
								mui.alert(app.b_lg['1306'], app.b_lg['1320'], "OK", function() {
									return
								}, "div")
							} else {
								var btnArray2 = [app.b_lg[1049], app.b_lg[1008]];
								mui.confirm(app.b_lg['1359'], app.b_lg['1320'], btnArray2, function(e) {
									if(e.index == 1) {
										var dat = {}
										if(!app.table_id) {
											app.table_id = getQueryString("table_id")
										}
										dat.shop_table_id = app.table_id //餐桌主键
										//							dat.is_pack = app.order_cli_pack //整单打包状态
										if(app.order_cli_pack == true) {
											dat.is_pack = 1
										} else {
											dat.is_pack = 0
										}
										if(app.order_cli_wait == true) {
											dat.is_wait = 1
										} else {
											dat.is_wait = 0
										}
										//							dat.is_wait = app.order_cli_wait //整单稍后上菜状态
										dat.pax = app.num_bth //用餐人数
										dat.cookbook_id = app.cookbook_id //菜谱id
										dat.remarks = app.remarks //整单备注
										dat.goods_list = [] //菜品列表
										console.log(app.sel_cookbook_memory_memory)
										//渲染菜谱列表
										$.each(app.sel_cookbook_memory_memory, function(k, v) {
											if(v.is_package_goods) {
												dat.goods_list.push(v)
											} else {
												var obj = {}
												if(v.is_old == 1) {
													obj.boss_id = v.boss_id
													obj.shop_id = v.shop_id
												}
												obj.addtime = v.addtime
												obj.cart_id = v.cart_id
												obj.goods_id = v.id
												obj.spec_id = v.spec_id
												obj.taste_id = v.taste_id
												obj.goods_cate_id = v.class_list
												obj.count = v.part
												if(v.pack == true) {
													obj.is_pack = 1
												} else {
													obj.is_pack = 0
												}
												if(v.wait == true) {
													obj.is_wait = 1
												} else {
													obj.is_wait = 0
												}
												obj.member_id = v.member_id
												obj.iscustom = "" //自定义暂无
												obj.garnish_ids = []

												$.each(v.garnish, function(k, v) {
													var ob = {}
													ob.garnish_id = v.garnish_id
													ob.count = v.num
													obj.garnish_ids.push(ob)
												})
												obj.remarks = ""
												$.each(v.beizhu.select, function(k, v) {
													obj.remarks = obj.remarks + app.beizhu_memory[v].name + ","
												})
												obj.remarks = obj.remarks + v.beizhu.cont
												obj.is_old = v.is_old

												dat.goods_list.push(obj)
											}

										})
										common_ajax("1", dat, "put_shop_order_confirm3", function(h) {
											if(h.status == "1") {
												//												if(isAPP) {
												//													Android_back_order("success")
												//												}
												app.cook = false
												app.order_success = true //点餐成功打开界面
											} else {
												mui.toast(h.msg)
											}
										})
									}

								}, "div")

							}

						},
						test_btn: function() {
							if(!app.beizhu) {
								$(".onoffswitch-label .onoffswitch-inner").css("margin-left", "0")
								$(".onoffswitch-label .onoffswitch-switch").css("right", "0")
								app.beizhu = !app.beizhu
							} else {
								$(".onoffswitch-label .onoffswitch-inner").css("margin-left", "-100%")
								$(".onoffswitch-label .onoffswitch-switch").css("right", "18px")
								app.beizhu = !app.beizhu
							}
						},
						improve_fun: function(e) { //修改订单							
							if(e == 1) {
								app.cook = true
								app.shade = false
							}
							var table_id = this.table_id
							var result = JSON.parse(getItem("get_shop_table_order_info")) //返回结果
							app.shop_card = result
							$.each(result.order_info, function(k, v) {
								app.table_id = table_id
								app.order_cli_pack = false
								app.order_cli_wait = false
								app.num_btn = v.pax
								app.remarks = v.remarks
							});

							if(result.goods_list) {
								$.each(result.goods_list, function(k, v) {
									$.each(v, function(k, v) {
										var obj = {}
										if(v.is_package_goods == 1) {
											var memory_boj = {};
											$.each(v.package_cate_list, function(k2, v2) {
												memory_boj[v2.id] = v2
											});
											v.package_cate_list = memory_boj;
											v.is_old = 1
											obj = v;
										} else {
											obj.boss_id = v.boss_id
											obj.shop_id = v.shop_id
											obj.addtime = v.addtime
											obj.table_id = table_id
											obj.cookbook_id = v.cookbook_id
											obj.id = v.goods_id
											obj.cart_id = v.cart_id
											obj.spec_id = v.spec_id
											obj.taste_id = v.taste_id
											obj.class_list = v.goods_cate_id
											obj.spec = v.total_price
											obj.spec_price = v.goods_price
											obj.is_old = 1
											obj.part = parseInt(v.count)
											obj.pack = v.is_pack
											obj.wait = v.is_wait
											obj.beizhu = {}
											obj.beizhu.cont = v.remarks
											obj.member_id = v.member_id
											obj.count_old = v.count
											if(v.remarks) {
												obj.beizhu.off = true
												obj.beizhu.select = {}
											} else {
												obj.beizhu.off = false
												obj.beizhu.select = {}
											}
											obj.garnish = {}
											$.each(v.garnish_ids, function(k, v) {
												obj.garnish[v.garnish_id] = {
													garnish_id: v.garnish_id,
													num: v.count
												}
											});
										}
										app.sel_cookbook_memory_memory.push(obj)
									})

								})
								$.each(app.sel_cookbook_memory_memory, function(k, v) {
									app.select_cookbook(app.cookbook[v.cookbook_id], v.cookbook_id)
									return false
								})
								//统计出购物车的总金额
								var spec_all = 0
								var num_all = 0
								$.each(app.sel_cookbook_memory_memory, function(k, v) {
									if(v.is_package_goods == 1) { //为1的时候说明是套餐
										spec_all = spec_all + parseFloat(v.total_price * v.count)
										num_all = num_all + parseInt(v.count)
									} else {
										spec_all = spec_all + parseFloat(v.spec * v.part)
										num_all = num_all + parseInt(v.part)
									}
								})
								app.shop_all.spec = spec_all
								app.shop_all.num = num_all

							}

						},
						jum_work: function() {
							if(isAPP) {
								var w = plus.webview.getLaunchWebview();
								w.evalJS('refresh(1)')
								var op = plus.webview.currentWebview().opener()
								var preUrl = plus.webview.getWebviewById(getItem("tableStatus.html"));
								preUrl.close()
								var ws = plus.webview.currentWebview()
								plus.webview.close(op.id)
								plus.webview.close(ws.id)

							} else {
								jum("../work/index.html")
							}
						},
						jum_table: function() { //返回我的桌台
							if(isAPP) {
								var ws = plus.webview.currentWebview()
								if(ba_k == "con_order") {
									if(getQueryString("leave") == "index") {
										var ms = plus.webview.currentWebview().opener()
										plus.webview.close(ms.id, false)
										clicked("../work/tableStatus.html?close=Order")
									} else {
										var ms = plus.webview.currentWebview().opener()
										plus.webview.close(ms.id, false)
										var my = plus.webview.currentWebview()
										plus.webview.close(my.id)
									}

								} else if(ba_k == "tab_sta") {
									var preUrl = plus.webview.getWebviewById(getItem("tableStatus.html"));
									preUrl.evalJS('refresh()')
									plus.webview.close(ws.id)
								}
							} else {
								jum("../work/tableStatus.html")
							}
						},
						reset_fun: function() {
							app.old = 0
							app.shopping_cart.spec.spec_id = "" //规格
							app.shopping_cart.taste.taste_id = "" //口味
							app.shopping_cart.garnish.garnish_detail = {} //配菜
							app.shopping_cart.garnish.garnish_price = {} //配菜价格
							app.pack = ""
							app.wait = ""
							app.table_id = ""
							app.active = ""
							app.taste_sel.switch_s = ""
							app.total_money = 0
						},
						add_food: function() {
							// if(app.get_old==1){
							// 	jum("../set/confirmedOrder.html?table=" + app.table_id + "&type=1");

							// }else{
							// 	app.jum_table();
							// }
							var ms = plus.webview.currentWebview().opener()
							ms.evalJS('refresh()')
							setTimeout(function() {
								back();
							}, 1000)

						}

					}
				})
				//				if(isAPP) {
				//					And_back(ba_k)
				//				}

				function Android_back_order(page) {
					mui.back = function() {}
					And_back("no");
					plus.key.removeEventListener("backbutton", close_food);
					plus.key.removeEventListener("backbutton", close_food2);
					plus.key.removeEventListener("backbutton", close_food3);
					plus.key.removeEventListener("backbutton", close_food4);
					plus.key.removeEventListener("backbutton", close_food5);
					plus.key.removeEventListener("backbutton", close_food6);
					plus.key.removeEventListener("backbutton", close_food7);
					if(page == "order") {
						plus.key.addEventListener("backbutton", close_food, false);
					} else if(page == "list") {
						plus.key.addEventListener("backbutton", close_food2, false);
					} else if(page == "change_order") {
						plus.key.addEventListener("backbutton", close_food3, false);
					} else if(page == "alter") {
						plus.key.addEventListener("backbutton", close_food4, false);
					} else if(page == "search") {
						plus.key.addEventListener("backbutton", close_food5, false);
					} else if(page == "success") {
						plus.key.addEventListener("backbutton", close_food6, false);
					} else if(page == "search_select") {
						plus.key.addEventListener("backbutton", close_food7, false);
					}
				}

				function close_food() {
					app.close_select_show()
				}

				function close_food2() {
					app.clo_cook_content()
				}

				function close_food3() {
					And_back('no')
					app.close_select_show()
					//					Android_back_order("alter")
				}

				function close_food4() {
					app.clo_cook_content()
				}

				function close_food5() {
					app.search_back()
					And_back(ba_k)
				}

				function close_food6() {
					app.add_food();
				}

				function close_food7() {
					app.close_select_show()
					//					Android_back_order("search")
				}

			}
		</script>
	</body>

</html>